Skip to content

Commit

Permalink
(WIP) Namecoin / AuxPoW: Add prev_hash to checkpoint logic
Browse files Browse the repository at this point in the history
TODO: Fill this in for Bitcoin; maybe submit upstream to Electrum.
  • Loading branch information
JeremyRand committed Mar 25, 2019
1 parent 55b85d9 commit 14ea0aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions electrum/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,8 @@ def get_hash(self, height: int) -> str:
return '0000000000000000000000000000000000000000000000000000000000000000'
elif height == 0:
return constants.net.GENESIS
elif height == (constants.net.max_checkpoint() + 1) // 2016 * 2016 - 1:
return constants.net.VERIFICATION_BLOCK_LAST_HASH
else:
header = self.read_header(height)
if header is None:
Expand Down
2 changes: 2 additions & 0 deletions electrum/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class BitcoinMainnet(AbstractNet):
VERIFICATION_BLOCK_LAST_CHAINWORK = 1458314160032177082968012064
# Bits used in height + 1
VERIFICATION_BLOCK_LAST_BITS = 389010995
# Hash of (height + 1) // 2016 * 2016 - 1
VERIFICATION_BLOCK_LAST_HASH = "TODO"

XPRV_HEADERS = {
'standard': 0x0488ade4, # xprv
Expand Down

0 comments on commit 14ea0aa

Please sign in to comment.