From e0b333682222927d64217b07bb8cfd7ff3139660 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Wed, 15 Jan 2025 03:22:19 +0100 Subject: [PATCH] test: p2p: fix sending of manual INVs in tx download test The `test_inv_block` sub-test in p2p_tx_download.py has a subtle bug: the manual msg_inv announcements from peers currently have no effect, since they don't match the wtxidrelay setting (=true by default for `P2PInterface` instances) and are hence ignored by the nodes (since 2d282e0c / PR #18044). Though the test still passes, it does so without the intended scenario of asking an additional peer (triggering the GETDATA_TX_INTERVAL delay). Fix this by sending the INV message with MSG_WTX instead of MSG_TX. This increases the test run time by about one minute. --- test/functional/p2p_tx_download.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/p2p_tx_download.py b/test/functional/p2p_tx_download.py index c69d6ff405..f6c28b00d9 100755 --- a/test/functional/p2p_tx_download.py +++ b/test/functional/p2p_tx_download.py @@ -93,11 +93,11 @@ class TxDownloadTest(BitcoinTestFramework): def test_inv_block(self): self.log.info("Generate a transaction on node 0") tx = self.wallet.create_self_transfer() - txid = int(tx['txid'], 16) + wtxid = int(tx['wtxid'], 16) self.log.info( "Announce the transaction to all nodes from all {} incoming peers, but never send it".format(NUM_INBOUND)) - msg = msg_inv([CInv(t=MSG_TX, h=txid)]) + msg = msg_inv([CInv(t=MSG_WTX, h=wtxid)]) for p in self.peers: p.send_and_ping(msg)