@@ -229,8 +229,7 @@ def test_preferred_inv(self, connection_type: ConnectionType):
229229 else :
230230 peer = self .nodes [0 ].add_p2p_connection (TestP2PConn ())
231231
232- peer .send_message (msg_inv ([CInv (t = MSG_WTX , h = 0xff00ff00 )]))
233- peer .sync_with_ping ()
232+ peer .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = 0xff00ff00 )]))
234233 if connection_type != ConnectionType .INBOUND :
235234 peer .wait_until (lambda : peer .tx_getdata_count >= 1 , timeout = 1 )
236235 else :
@@ -250,17 +249,15 @@ def test_preferred_tiebreaker_inv(self):
250249 # of which is preferred and one which is not
251250 unresponsive_peer = self .nodes [0 ].add_outbound_p2p_connection (
252251 TestP2PConn (), wait_for_verack = True , p2p_idx = 0 , connection_type = "outbound-full-relay" )
253- unresponsive_peer .send_message (msg_inv ([CInv (t = MSG_WTX , h = 0xff00ff00 )]))
254- unresponsive_peer .sync_with_ping ()
252+ unresponsive_peer .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = 0xff00ff00 )]))
255253 unresponsive_peer .wait_until (lambda : unresponsive_peer .tx_getdata_count >= 1 , timeout = 1 )
256254
257255 # A bunch of incoming (non-preferred) connections that advertise the same tx
258256 non_pref_peers = []
259257 NUM_INBOUND = 10
260258 for _ in range (NUM_INBOUND ):
261259 non_pref_peers .append (self .nodes [0 ].add_p2p_connection (TestP2PConn ()))
262- non_pref_peers [- 1 ].send_message (msg_inv ([CInv (t = MSG_WTX , h = 0xff00ff00 )]))
263- non_pref_peers [- 1 ].sync_with_ping ()
260+ non_pref_peers [- 1 ].send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = 0xff00ff00 )]))
264261
265262 # Check that no request made due to in-flight
266263 self .nodes [0 ].bumpmocktime (NONPREF_PEER_TX_DELAY )
@@ -272,8 +269,7 @@ def test_preferred_tiebreaker_inv(self):
272269 # upon advertisement
273270 pref_peer = self .nodes [0 ].add_outbound_p2p_connection (
274271 TestP2PConn (), wait_for_verack = True , p2p_idx = 1 , connection_type = "outbound-full-relay" )
275- pref_peer .send_message (msg_inv ([CInv (t = MSG_WTX , h = 0xff00ff00 )]))
276- pref_peer .sync_with_ping ()
272+ pref_peer .send_and_ping (msg_inv ([CInv (t = MSG_WTX , h = 0xff00ff00 )]))
277273
278274 assert_equal (len (self .nodes [0 ].getpeerinfo ()), NUM_INBOUND + 2 )
279275
@@ -302,8 +298,7 @@ def test_txid_inv_delay(self, glob_wtxid=False):
302298 # Add a second wtxid-relay connection otherwise TXID_RELAY_DELAY is waived in
303299 # lack of wtxid-relay peers
304300 self .nodes [0 ].add_p2p_connection (TestP2PConn (wtxidrelay = True ))
305- peer .send_message (msg_inv ([CInv (t = MSG_TX , h = 0xff11ff11 )]))
306- peer .sync_with_ping ()
301+ peer .send_and_ping (msg_inv ([CInv (t = MSG_TX , h = 0xff11ff11 )]))
307302 with p2p_lock :
308303 assert_equal (peer .tx_getdata_count , 0 if glob_wtxid else 1 )
309304 self .nodes [0 ].setmocktime (mock_time + TXID_RELAY_DELAY )
0 commit comments