Skip to content

Commit 083770a

Browse files
committed
Merge bitcoin#31414: test: orphan parent is re-requested from 2nd peer
0f84cdd func: test orphan parent is re-requested from 2nd peer (Greg Sanders) Pull request description: Small test which I couldn't find coverage for. ACKs for top commit: glozow: lgtm ACK 0f84cdd tdb3: code review ACK 0f84cdd theStack: ACK 0f84cdd marcofleon: tACK 0f84cdd. Removing `node.bumpmocktime(GETDATA_TX_INTERVAL)` results in failure. Tree-SHA512: fe8cb9d56aabc8f2ef1f49b6cd4e87e28a51ada8070c698f60c5fd945a28d849f0c5793f2e3e29f013e610168b860e0bf1c0aa010eec5b339688269d2b9e69af
2 parents e8cc790 + 0f84cdd commit 083770a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/functional/p2p_orphan_handling.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def test_orphans_overlapping_parents(self):
339339

340340
# The wtxid and txid need to be the same for the node to recognize that the missing input
341341
# and in-flight request for inflight_parent_AB are the same transaction.
342-
assert_equal(inflight_parent_AB["txid"], inflight_parent_AB["tx"].getwtxid())
342+
assert_equal(inflight_parent_AB["txid"], inflight_parent_AB["wtxid"])
343343

344344
# Announce inflight_parent_AB and wait for getdata
345345
peer_txrequest.send_and_ping(msg_inv([CInv(t=MSG_WTX, h=int(inflight_parent_AB["tx"].getwtxid(), 16))]))
@@ -365,6 +365,10 @@ def test_orphans_overlapping_parents(self):
365365
peer_orphans.wait_for_parent_requests([int(missing_parent_B["txid"], 16)])
366366
peer_orphans.assert_never_requested(int(inflight_parent_AB["txid"], 16))
367367

368+
# But inflight_parent_AB will be requested eventually if original peer doesn't respond
369+
node.bumpmocktime(GETDATA_TX_INTERVAL)
370+
peer_orphans.wait_for_parent_requests([int(inflight_parent_AB["txid"], 16)])
371+
368372
@cleanup
369373
def test_orphan_of_orphan(self):
370374
node = self.nodes[0]

0 commit comments

Comments
 (0)