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.
This commit is contained in:
Sebastian Falbesoner 2025-01-15 03:22:19 +01:00
parent e7c4794955
commit e0b3336822

View file

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