diff --git a/test/functional/p2p_orphan_handling.py b/test/functional/p2p_orphan_handling.py index 4a2d53cd2b3..dc58a220682 100755 --- a/test/functional/p2p_orphan_handling.py +++ b/test/functional/p2p_orphan_handling.py @@ -59,7 +59,7 @@ def wrapper(self): self.nodes[0].disconnect_p2ps() self.nodes[0].bumpmocktime(LONG_TIME_SKIP) # Check that mempool and orphanage have been cleared - assert_equal(0, len(self.nodes[0].getorphantxs())) + self.wait_until(lambda: len(self.nodes[0].getorphantxs()) == 0) assert_equal(0, len(self.nodes[0].getrawmempool())) self.wallet.rescan_utxos(include_mempool=True) return wrapper