Skip to content

Commit

Permalink
Namecoin / AuxPoW: remove accidental Namecoin rebranding in auxpow br…
Browse files Browse the repository at this point in the history
…anch
  • Loading branch information
JeremyRand committed Jan 20, 2019
1 parent 3e13fe8 commit 5d9dbbf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions electrum/auxpow.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ def deserialize_auxpow_header(base_header, s, expect_trailing_data=False, start_
# Finally there's the parent header. Deserialize it, along with any
# trailing data if requested.
if expect_trailing_data:
auxpow_header['parent_header'], start_position = electrum_nmc.blockchain.deserialize_header(s, 1, expect_trailing_data=expect_trailing_data, start_position=start_position)
auxpow_header['parent_header'], start_position = electrum.blockchain.deserialize_header(s, 1, expect_trailing_data=expect_trailing_data, start_position=start_position)
else:
auxpow_header['parent_header'] = electrum_nmc.blockchain.deserialize_header(s, 1, expect_trailing_data=expect_trailing_data, start_position=start_position)
auxpow_header['parent_header'] = electrum.blockchain.deserialize_header(s, 1, expect_trailing_data=expect_trailing_data, start_position=start_position)
# The parent block header doesn't have any block height,
# so delete that field. (We used 1 as a dummy value above.)
del auxpow_header['parent_header']['block_height']
Expand Down Expand Up @@ -131,19 +131,19 @@ def strip_auxpow_headers(index, chunk):

i = 0
while len(trailing_data) > 0:
header, trailing_data = electrum_nmc.blockchain.deserialize_header(trailing_data, index*2016 + i, expect_trailing_data=True)
result.extend(bfh(electrum_nmc.blockchain.serialize_header(header)))
header, trailing_data = electrum.blockchain.deserialize_header(trailing_data, index*2016 + i, expect_trailing_data=True)
result.extend(bfh(electrum.blockchain.serialize_header(header)))
i = i + 1

return bytes(result)

def hash_parent_header(header):
if not auxpow_active(header):
return electrum_nmc.blockchain.hash_header(header)
return electrum.blockchain.hash_header(header)

verify_auxpow(header)

return electrum_nmc.blockchain.hash_header(header['auxpow']['parent_header'])
return electrum.blockchain.hash_header(header['auxpow']['parent_header'])

# Reimplementation of btcutils.check_merkle_branch from Electrum-DOGE.
# btcutils seems to have an unclear license and no obvious Git repo, so it
Expand Down Expand Up @@ -176,7 +176,7 @@ def calc_merkle_index(chain_id, nonce, merkle_size):
# Copied from Electrum-DOGE
# TODO: Audit this function carefully.
def verify_auxpow(header):
auxhash = electrum_nmc.blockchain.hash_header(header)
auxhash = electrum.blockchain.hash_header(header)
auxpow = header['auxpow']

parent_block = auxpow['parent_header']
Expand Down

0 comments on commit 5d9dbbf

Please sign in to comment.