@@ -210,9 +210,9 @@ def test_orphan_rejected_parents_exceptions(self):
210
210
211
211
# Relay the child. It should not be accepted because it has missing inputs.
212
212
# Its parent should not be requested because its hash (txid == wtxid) has been added to the rejection filter.
213
- with node .assert_debug_log (['not keeping orphan with rejected parents {}' .format (child_nonsegwit ["txid" ])]):
214
- self .relay_transaction (peer2 , child_nonsegwit ["tx" ])
213
+ self .relay_transaction (peer2 , child_nonsegwit ["tx" ])
215
214
assert child_nonsegwit ["txid" ] not in node .getrawmempool ()
215
+ assert not tx_in_orphanage (node , child_nonsegwit ["tx" ])
216
216
217
217
# No parents are requested.
218
218
self .nodes [0 ].bumpmocktime (GETDATA_TX_INTERVAL )
@@ -402,15 +402,15 @@ def test_orphan_inherit_rejection(self):
402
402
403
403
# Relay the child. It should be rejected for having missing parents, and this rejection is
404
404
# cached by txid and wtxid.
405
- with node .assert_debug_log (['not keeping orphan with rejected parents {}' .format (child ["txid" ])]):
406
- self .relay_transaction (peer1 , child ["tx" ])
405
+ self .relay_transaction (peer1 , child ["tx" ])
407
406
assert_equal (0 , len (node .getrawmempool ()))
407
+ assert not tx_in_orphanage (node , child ["tx" ])
408
408
peer1 .assert_never_requested (parent_low_fee_nonsegwit ["txid" ])
409
409
410
410
# Grandchild should also not be kept in orphanage because its parent has been rejected.
411
- with node .assert_debug_log (['not keeping orphan with rejected parents {}' .format (grandchild ["txid" ])]):
412
- self .relay_transaction (peer2 , grandchild ["tx" ])
411
+ self .relay_transaction (peer2 , grandchild ["tx" ])
413
412
assert_equal (0 , len (node .getrawmempool ()))
413
+ assert not tx_in_orphanage (node , grandchild ["tx" ])
414
414
peer2 .assert_never_requested (child ["txid" ])
415
415
peer2 .assert_never_requested (child ["tx" ].getwtxid ())
416
416
@@ -446,8 +446,9 @@ def test_same_txid_orphan(self):
446
446
447
447
# 3. Honest peer relays the real child, which is also missing parents and should be placed
448
448
# in the orphanage.
449
- with node .assert_debug_log (["missingorspent" , "stored orphan tx" ]):
449
+ with node .assert_debug_log (["missingorspent" ]):
450
450
honest_peer .send_and_ping (msg_tx (tx_child ["tx" ]))
451
+ assert tx_in_orphanage (node , tx_child ["tx" ])
451
452
452
453
# Time out the previous request for the parent (node will not request the same transaction
453
454
# from multiple nodes at the same time)
@@ -496,16 +497,16 @@ def test_same_txid_orphan_of_orphan(self):
496
497
# 3. Honest peer relays the grandchild, which is missing a parent. The parent by txid already
497
498
# exists in orphanage, but should be re-requested because the node shouldn't assume that the
498
499
# witness data is the same. In this case, a same-txid-different-witness transaction exists!
499
- with node . assert_debug_log ([ "stored orphan tx" ]):
500
- honest_peer . send_and_ping ( msg_tx ( tx_grandchild ["tx" ]) )
500
+ honest_peer . send_and_ping ( msg_tx ( tx_grandchild [ " tx" ]))
501
+ assert tx_in_orphanage ( node , tx_grandchild ["tx" ])
501
502
middle_txid_int = int (tx_middle ["txid" ], 16 )
502
503
node .bumpmocktime (NONPREF_PEER_TX_DELAY + TXID_RELAY_DELAY )
503
504
honest_peer .wait_for_getdata ([middle_txid_int ])
504
505
505
506
# 4. Honest peer relays the real child, which is also missing parents and should be placed
506
507
# in the orphanage.
507
- with node . assert_debug_log ([ "stored orphan tx" ]):
508
- honest_peer . send_and_ping ( msg_tx ( tx_middle ["tx" ]) )
508
+ honest_peer . send_and_ping ( msg_tx ( tx_middle [ " tx" ]))
509
+ assert tx_in_orphanage ( node , tx_middle ["tx" ])
509
510
assert_equal (len (node .getrawmempool ()), 0 )
510
511
511
512
# 5. Honest peer sends tx_grandparent
@@ -550,8 +551,8 @@ def test_orphan_txid_inv(self):
550
551
# 4. The child is requested. Honest peer sends it.
551
552
node .bumpmocktime (TXREQUEST_TIME_SKIP )
552
553
honest_peer .wait_for_getdata ([child_txid_int ])
553
- with node . assert_debug_log ([ "stored orphan tx" ]):
554
- honest_peer . send_and_ping ( msg_tx ( tx_child ["tx" ]) )
554
+ honest_peer . send_and_ping ( msg_tx ( tx_child [ " tx" ]))
555
+ assert tx_in_orphanage ( node , tx_child ["tx" ])
555
556
556
557
# 5. After first parent request times out, the node sends another one for the missing parent
557
558
# of the real orphan child.
0 commit comments