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

@@ -181,7 +181,8 @@ class Blockchain(util.PrintError):
if d < 0:
chunk = chunk[-d:]
d = 0
self.write(chunk, d, index > len(self.checkpoints))
truncate = index >= len(self.checkpoints)
self.write(chunk, d, truncate)
self.swap_with_parent()
def swap_with_parent(self):
@@ -338,7 +339,7 @@ class Blockchain(util.PrintError):
self.save_chunk(idx, data)
return True
except BaseException as e:
self.print_error('verify_chunk failed', str(e))
self.print_error('verify_chunk %d failed'%idx, str(e))
return False
def get_checkpoints(self):