mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 09:21:39 +00:00
sanitize pass_checkpoint
This commit is contained in:
parent
d371e1c807
commit
1b14a18b1a
1 changed files with 9 additions and 1 deletions
|
@ -55,9 +55,17 @@ class Blockchain(util.PrintError):
|
|||
t.start()
|
||||
|
||||
def pass_checkpoint(self, header):
|
||||
if type(header) is not dict:
|
||||
return False
|
||||
if header.get('block_height') != self.checkpoint_height:
|
||||
return True
|
||||
return self.hash_header(header) == self.checkpoint_hash
|
||||
if header.get('prev_block_hash') is None:
|
||||
header['prev_block_hash'] = '00'*32
|
||||
try:
|
||||
_hash = self.hash_header(header)
|
||||
except:
|
||||
return False
|
||||
return _hash == self.checkpoint_hash
|
||||
|
||||
def verify_header(self, header, prev_header, bits, target):
|
||||
prev_hash = self.hash_header(prev_header)
|
||||
|
|
Loading…
Add table
Reference in a new issue