mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -04:00
Merge bitcoin/bitcoin#31414: test: orphan parent is re-requested from 2nd peer
0f84cdd266
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 ACK0f84cdd266
tdb3: code review ACK0f84cdd266
theStack: ACK0f84cdd266
marcofleon: tACK0f84cdd266
. Removing `node.bumpmocktime(GETDATA_TX_INTERVAL)` results in failure. Tree-SHA512: fe8cb9d56aabc8f2ef1f49b6cd4e87e28a51ada8070c698f60c5fd945a28d849f0c5793f2e3e29f013e610168b860e0bf1c0aa010eec5b339688269d2b9e69af
This commit is contained in:
commit
083770adbe
1 changed files with 5 additions and 1 deletions
|
@ -339,7 +339,7 @@ class OrphanHandlingTest(BitcoinTestFramework):
|
||||||
|
|
||||||
# The wtxid and txid need to be the same for the node to recognize that the missing input
|
# The wtxid and txid need to be the same for the node to recognize that the missing input
|
||||||
# and in-flight request for inflight_parent_AB are the same transaction.
|
# and in-flight request for inflight_parent_AB are the same transaction.
|
||||||
assert_equal(inflight_parent_AB["txid"], inflight_parent_AB["tx"].getwtxid())
|
assert_equal(inflight_parent_AB["txid"], inflight_parent_AB["wtxid"])
|
||||||
|
|
||||||
# Announce inflight_parent_AB and wait for getdata
|
# Announce inflight_parent_AB and wait for getdata
|
||||||
peer_txrequest.send_and_ping(msg_inv([CInv(t=MSG_WTX, h=int(inflight_parent_AB["tx"].getwtxid(), 16))]))
|
peer_txrequest.send_and_ping(msg_inv([CInv(t=MSG_WTX, h=int(inflight_parent_AB["tx"].getwtxid(), 16))]))
|
||||||
|
@ -365,6 +365,10 @@ class OrphanHandlingTest(BitcoinTestFramework):
|
||||||
peer_orphans.wait_for_parent_requests([int(missing_parent_B["txid"], 16)])
|
peer_orphans.wait_for_parent_requests([int(missing_parent_B["txid"], 16)])
|
||||||
peer_orphans.assert_never_requested(int(inflight_parent_AB["txid"], 16))
|
peer_orphans.assert_never_requested(int(inflight_parent_AB["txid"], 16))
|
||||||
|
|
||||||
|
# But inflight_parent_AB will be requested eventually if original peer doesn't respond
|
||||||
|
node.bumpmocktime(GETDATA_TX_INTERVAL)
|
||||||
|
peer_orphans.wait_for_parent_requests([int(inflight_parent_AB["txid"], 16)])
|
||||||
|
|
||||||
@cleanup
|
@cleanup
|
||||||
def test_orphan_of_orphan(self):
|
def test_orphan_of_orphan(self):
|
||||||
node = self.nodes[0]
|
node = self.nodes[0]
|
||||||
|
|
Loading…
Add table
Reference in a new issue