Skip to content

Commit e0b3336

Browse files
committed
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 2d282e0 / 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.
1 parent e7c4794 commit e0b3336

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/functional/p2p_tx_download.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ def getdata_found(peer_index):
9393
def test_inv_block(self):
9494
self.log.info("Generate a transaction on node 0")
9595
tx = self.wallet.create_self_transfer()
96-
txid = int(tx['txid'], 16)
96+
wtxid = int(tx['wtxid'], 16)
9797

9898
self.log.info(
9999
"Announce the transaction to all nodes from all {} incoming peers, but never send it".format(NUM_INBOUND))
100-
msg = msg_inv([CInv(t=MSG_TX, h=txid)])
100+
msg = msg_inv([CInv(t=MSG_WTX, h=wtxid)])
101101
for p in self.peers:
102102
p.send_and_ping(msg)
103103

0 commit comments

Comments
 (0)