mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-12 15:49:31 +02:00
test: rename CBlockHeader .hash -> .hash_hex for consistency
Note that we unfortunately can't use a scripted diff here, as the `.hash` symbol is also used for other instances (e.g. CInv).
This commit is contained in:
@@ -288,17 +288,17 @@ class InvalidMessagesTest(BitcoinTestFramework):
|
||||
blockheader.hashPrevBlock = int(blockheader_tip_hash, 16)
|
||||
blockheader.nTime = int(time.time())
|
||||
blockheader.nBits = blockheader_tip.nBits
|
||||
while not blockheader.hash.startswith('0'):
|
||||
while not blockheader.hash_hex.startswith('0'):
|
||||
blockheader.nNonce += 1
|
||||
peer = self.nodes[0].add_p2p_connection(P2PInterface())
|
||||
peer.send_and_ping(msg_headers([blockheader]))
|
||||
assert_equal(self.nodes[0].getblockchaininfo()['headers'], 1)
|
||||
chaintips = self.nodes[0].getchaintips()
|
||||
assert_equal(chaintips[0]['status'], 'headers-only')
|
||||
assert_equal(chaintips[0]['hash'], blockheader.hash)
|
||||
assert_equal(chaintips[0]['hash'], blockheader.hash_hex)
|
||||
|
||||
# invalidate PoW
|
||||
while not blockheader.hash.startswith('f'):
|
||||
while not blockheader.hash_hex.startswith('f'):
|
||||
blockheader.nNonce += 1
|
||||
with self.nodes[0].assert_debug_log(['Misbehaving', 'header with invalid proof of work']):
|
||||
peer.send_without_ping(msg_headers([blockheader]))
|
||||
|
||||
Reference in New Issue
Block a user