File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -926,9 +926,9 @@ def test_tx_relay_after_segwit_activation(self):
926
926
tx3 .wit .vtxinwit [0 ].scriptWitness .stack = [ witness_program ]
927
927
# Also check that old_node gets a tx announcement, even though this is
928
928
# a witness transaction.
929
- self .old_node .wait_for_inv (CInv (1 , tx2 .sha256 )) # wait until tx2 was inv'ed
929
+ self .old_node .wait_for_inv ([ CInv (1 , tx2 .sha256 )] ) # wait until tx2 was inv'ed
930
930
self .test_node .test_transaction_acceptance (tx3 , with_witness = True , accepted = True )
931
- self .old_node .wait_for_inv (CInv (1 , tx3 .sha256 ))
931
+ self .old_node .wait_for_inv ([ CInv (1 , tx3 .sha256 )] )
932
932
933
933
# Test that getrawtransaction returns correct witness information
934
934
# hash, size, vsize
Original file line number Diff line number Diff line change @@ -1604,7 +1604,12 @@ def wait_for_getheaders(self, timeout=60):
1604
1604
assert wait_until (test_function , timeout = timeout )
1605
1605
1606
1606
def wait_for_inv (self , expected_inv , timeout = 60 ):
1607
- test_function = lambda : self .last_message .get ("inv" ) and self .last_message ["inv" ] != expected_inv
1607
+ """Waits for an INV message and checks that the first inv object in the message was as expected."""
1608
+ if len (expected_inv ) > 1 :
1609
+ raise NotImplementedError ("wait_for_inv() will only verify the first inv object" )
1610
+ test_function = lambda : self .last_message .get ("inv" ) and \
1611
+ self .last_message ["inv" ].inv [0 ].type == expected_inv [0 ].type and \
1612
+ self .last_message ["inv" ].inv [0 ].hash == expected_inv [0 ].hash
1608
1613
assert wait_until (test_function , timeout = timeout )
1609
1614
1610
1615
def wait_for_verack (self , timeout = 60 ):
You can’t perform that action at this time.
0 commit comments