Skip to content

Commit 7777598

Browse files
author
MarcoFalke
committed
test: Fix intermittent timeout waiting for ibd_wtxid getdata
1 parent f86c614 commit 7777598

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

‎test/functional/p2p_ibd_txrelay.py‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313

1414
from test_framework.blocktools import create_block
1515
from test_framework.messages import (
16-
CInv,
17-
COIN,
18-
CTransaction,
19-
from_hex,
20-
msg_inv,
21-
msg_tx,
22-
MSG_WTX,
16+
CInv,
17+
COIN,
18+
CTransaction,
19+
from_hex,
20+
msg_inv,
21+
msg_tx,
22+
MSG_WTX,
2323
)
2424
from test_framework.p2p import (
25-
NONPREF_PEER_TX_DELAY,
26-
P2PDataStore,
27-
P2PInterface,
28-
p2p_lock
25+
NONPREF_PEER_TX_DELAY,
26+
P2PDataStore,
27+
P2PInterface,
28+
p2p_lock,
2929
)
3030
from test_framework.test_framework import BitcoinTestFramework
3131

@@ -54,6 +54,9 @@ def run_test(self):
5454
block.solve()
5555
self.nodes[0].submitblock(block.serialize().hex())
5656
assert self.nodes[0].getblockchaininfo()['initialblockdownload']
57+
# BlockConnected is async. Sync while in IBD so a delayed event cannot
58+
# add ibd_wtxid to the recently-confirmed filter.
59+
self.nodes[0].syncwithvalidationinterfacequeue()
5760
ibd_wtxid = int(self.nodes[0].getblock(f"{block.hash_int:064x}", 2)["tx"][0]["hash"], 16)
5861

5962
self.log.info("Check that nodes don't send getdatas for transactions while still in IBD")

0 commit comments

Comments
 (0)