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:
Sebastian Falbesoner
2025-06-12 15:13:11 +02:00
parent 23be0ec2f0
commit 2118301d77
22 changed files with 84 additions and 84 deletions

View File

@@ -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]))