request headers chunk if we need more than 50 blocks
This commit is contained in:
parent
be6aab538d
commit
18c9c2f369
@ -66,15 +66,16 @@ class WalletVerifier(threading.Thread):
|
|||||||
|
|
||||||
while True:
|
while True:
|
||||||
# request missing chunks
|
# request missing chunks
|
||||||
max_index = (self.height+1)/2016
|
|
||||||
if not all_chunks and self.height and not requested_chunks:
|
if not all_chunks and self.height and not requested_chunks:
|
||||||
for i in range(0, max_index + 1):
|
|
||||||
# test if we can read the first header of the chunk
|
if self.local_height + 50 < self.height:
|
||||||
if self.read_header(i*2016): continue
|
min_index = (self.local_height + 1)/2016
|
||||||
# print "requesting chunk", i
|
max_index = (self.height + 1)/2016
|
||||||
self.interface.send([ ('blockchain.block.get_chunk',[i])], 'verifier')
|
for i in range(min_index, max_index + 1):
|
||||||
requested_chunks.append(i)
|
# print "requesting chunk", i
|
||||||
break
|
self.interface.send([ ('blockchain.block.get_chunk',[i])], 'verifier')
|
||||||
|
requested_chunks.append(i)
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
all_chunks = True
|
all_chunks = True
|
||||||
print_error("downloaded all chunks")
|
print_error("downloaded all chunks")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user