Skip to content

Commit

Permalink
test: request parents of orphan from wtxid relay peer
Browse files Browse the repository at this point in the history
  • Loading branch information
ajtowns authored and sipa committed Jul 30, 2020
1 parent 900d7f6 commit e65d115
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/functional/p2p_segwit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2133,17 +2133,17 @@ def received_wtxidrelay():

# Send tx2 through; it's an orphan so won't be accepted
with mininode_lock:
self.tx_node.last_message.pop("getdata", None)
test_transaction_acceptance(self.nodes[0], self.tx_node, tx2, with_witness=True, accepted=False)
self.wtx_node.last_message.pop("getdata", None)
test_transaction_acceptance(self.nodes[0], self.wtx_node, tx2, with_witness=True, accepted=False)

# Expect a request for parent (tx) due to use of non-WTX peer
self.tx_node.wait_for_getdata([tx.sha256], 60)
# Expect a request for parent (tx) by txid despite use of WTX peer
self.wtx_node.wait_for_getdata([tx.sha256], 60)
with mininode_lock:
lgd = self.tx_node.lastgetdata[:]
lgd = self.wtx_node.lastgetdata[:]
assert_equal(lgd, [CInv(MSG_TX|MSG_WITNESS_FLAG, tx.sha256)])

# Send tx through
test_transaction_acceptance(self.nodes[0], self.tx_node, tx, with_witness=False, accepted=True)
test_transaction_acceptance(self.nodes[0], self.wtx_node, tx, with_witness=False, accepted=True)

# Check tx2 is there now
assert_equal(tx2.hash in self.nodes[0].getrawmempool(), True)
Expand Down

0 comments on commit e65d115

Please sign in to comment.