1
0

fix bug if headers file is empty

This commit is contained in:
ThomasV
2017-07-19 17:23:46 +02:00
parent 97343d95e5
commit feb0f483f5
2 changed files with 14 additions and 4 deletions

View File

@@ -286,6 +286,8 @@ class Blockchain(util.PrintError):
height = header['block_height']
if self.height() != height - 1:
return False
if height == 0:
return hash_header(header) == bitcoin.GENESIS
previous_header = self.read_header(height -1)
if not previous_header:
return False