0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-21 12:22:50 -05:00

test: add missing sync to p2p_tx_download.py

This prevents intermittent failures - if the node hasn't processed
the inv from the outbound peer before the mocktime bump, the peer
won't be preferred after the other inv timeouts, failing the test .
Therefore, add a sync, just like there is one after the send_message
calls in the previous lines.
This commit is contained in:
Martin Zumsande 2025-02-10 13:35:12 -05:00
parent 1d813e4bf5
commit 8fe552fe6e

View file

@ -274,6 +274,7 @@ class TxDownloadTest(BitcoinTestFramework):
pref_peer = self.nodes[0].add_outbound_p2p_connection( pref_peer = self.nodes[0].add_outbound_p2p_connection(
TestP2PConn(), wait_for_verack=True, p2p_idx=1, connection_type="outbound-full-relay") TestP2PConn(), wait_for_verack=True, p2p_idx=1, connection_type="outbound-full-relay")
pref_peer.send_message(msg_inv([CInv(t=MSG_WTX, h=0xff00ff00)])) pref_peer.send_message(msg_inv([CInv(t=MSG_WTX, h=0xff00ff00)]))
pref_peer.sync_with_ping()
assert_equal(len(self.nodes[0].getpeerinfo()), NUM_INBOUND + 2) assert_equal(len(self.nodes[0].getpeerinfo()), NUM_INBOUND + 2)