1
0

fix #3955: fix interference between verifier and catch_up

This commit is contained in:
ThomasV
2018-02-22 16:33:39 +01:00
parent 1f1844ac13
commit 0928ac961a
3 changed files with 15 additions and 9 deletions

View File

@@ -777,6 +777,7 @@ class Network(util.DaemonThread):
error = response.get('error')
result = response.get('result')
params = response.get('params')
blockchain = interface.blockchain
if result is None or params is None or error is not None:
interface.print_error(error or 'bad response')
return
@@ -785,17 +786,17 @@ class Network(util.DaemonThread):
if index not in self.requested_chunks:
return
self.requested_chunks.remove(index)
connect = interface.blockchain.connect_chunk(index, result)
connect = blockchain.connect_chunk(index, result)
if not connect:
self.connection_down(interface.server)
return
# If not finished, get the next chunk
if interface.blockchain.height() < interface.tip:
if index >= len(blockchain.checkpoints) and blockchain.height() < interface.tip:
self.request_chunk(interface, index+1)
else:
interface.mode = 'default'
interface.print_error('catch up done', interface.blockchain.height())
interface.blockchain.catch_up = None
interface.print_error('catch up done', blockchain.height())
blockchain.catch_up = None
self.notify('updated')
def request_header(self, interface, height):