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

test: make sure we are on sync with a peer before checking if they have sent a message

p2p_orphan_handling checks whether a message has not been requested slightly
too soon, making the check always succeed. This passes unnoticed since the
expected result is for the message to not have been received, but it will make
the test not catch a relevant change that should make it fail
This commit is contained in:
Sergi Delgado Segura 2025-01-29 14:37:33 -05:00
parent b432e36742
commit 3f4b104b1b

View file

@ -113,6 +113,7 @@ class PeerTxRelayer(P2PTxInvStore):
def assert_never_requested(self, txhash):
"""Check that the node has never sent us a getdata for this hash (int type)"""
self.sync_with_ping()
for getdata in self.getdata_received:
for request in getdata.inv:
assert request.hash != txhash