Skip to content

Commit

Permalink
(WIP) Namecoin / AuxPoW: Fix AuxPoW stripping detection
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRand committed Mar 25, 2019
1 parent 7db5c69 commit 55b85d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion electrum/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ def deserialize_header(s: bytes, height: int, expect_trailing_data=False, start_
h['nonce'] = hex_to_int(s[start_position+76:start_position+80])
h['block_height'] = height

if auxpow.auxpow_active(h) and height > constants.net.max_checkpoint():
# TODO: auxpow_stripped might have wrong result when request_chunk's tip argument is non-None.
auxpow_stripped = height // 2016 * 2016 + 2016 - 1 <= constants.net.max_checkpoint()
if auxpow.auxpow_active(h) and not auxpow_stripped:
if expect_trailing_data:
h['auxpow'], start_position = auxpow.deserialize_auxpow_header(h, s, expect_trailing_data=True, start_position=start_position+HEADER_SIZE)
else:
Expand Down

0 comments on commit 55b85d9

Please sign in to comment.