From 99bc552980d9a10da03e4b90c390bcd6cae686be Mon Sep 17 00:00:00 2001 From: Martin Zumsande Date: Fri, 1 Aug 2025 17:04:44 -0400 Subject: [PATCH] test: fix (w)txid confusion in p2p_leak_tx.py Before, we'd send a MSG_TX with a wtxid in it, which would always result in a notfound answer --- test/functional/p2p_leak_tx.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/functional/p2p_leak_tx.py b/test/functional/p2p_leak_tx.py index 29b00397c09..e09420ba5ee 100755 --- a/test/functional/p2p_leak_tx.py +++ b/test/functional/p2p_leak_tx.py @@ -106,24 +106,23 @@ class P2PLeakTxTest(BitcoinTestFramework): self.log.info("Running test up to {} times.".format(MAX_REPEATS)) for i in range(MAX_REPEATS): self.log.info('Run repeat {}'.format(i + 1)) - txid = self.miniwallet.send_self_transfer(from_node=self.gen_node)["wtxid"] + wtxid = self.miniwallet.send_self_transfer(from_node=self.gen_node)["wtxid"] want_tx = msg_getdata() - want_tx.inv.append(CInv(t=MSG_TX, h=int(txid, 16))) + want_tx.inv.append(CInv(t=MSG_WTX, h=int(wtxid, 16))) with p2p_lock: inbound_peer.last_message.pop('notfound', None) inbound_peer.send_and_ping(want_tx) - if inbound_peer.last_message.get('notfound'): - self.log.debug('tx {} was not yet announced to us.'.format(txid)) + self.log.debug('tx {} was not yet announced to us.'.format(wtxid)) self.log.debug("node has responded with a notfound message. End test.") - assert_equal(inbound_peer.last_message['notfound'].vec[0].hash, int(txid, 16)) + assert_equal(inbound_peer.last_message['notfound'].vec[0].hash, int(wtxid, 16)) with p2p_lock: inbound_peer.last_message.pop('notfound') break else: - self.log.debug('tx {} was already announced to us. Try test again.'.format(txid)) - assert int(txid, 16) in [inv.hash for inv in inbound_peer.last_message['inv'].inv] + self.log.debug('tx {} was already announced to us. Try test again.'.format(wtxid)) + assert int(wtxid, 16) in [inv.hash for inv in inbound_peer.last_message['inv'].inv] if __name__ == '__main__':