@@ -24,14 +24,14 @@ def set_test_params(self):
2424 # -whitelist is needed to avoid the trickling logic on node0
2525 self .set_dash_test_params (5 , 4 , [["-whitelist=127.0.0.1" ], [], [], [], ["-minrelaytxfee=0.001" ]])
2626
27+ # random delay before tx is actually send by network could take up to 30 seconds
2728 def wait_for_tx (self , txid , node , expected = True , timeout = 60 ):
2829 def check_tx ():
2930 try :
30- self .bump_mocktime (1 )
3131 return node .getrawtransaction (txid )
3232 except :
3333 return False
34- if self .wait_until (check_tx , timeout = timeout , sleep = 1 , do_assert = expected ) and not expected :
34+ if self .wait_until (check_tx , timeout = timeout , do_assert = expected ) and not expected :
3535 raise AssertionError ("waiting unexpectedly succeeded" )
3636
3737 def run_test (self ):
@@ -80,6 +80,7 @@ def run_test(self):
8080 txid = self .nodes [0 ].sendtoaddress (self .nodes [0 ].getnewaddress (), 1 )
8181 # Make sure nodes 1 and 2 received the TX before we continue,
8282 # otherwise it might announce the TX to node 3 when reconnecting
83+ self .bump_mocktime (30 )
8384 self .wait_for_tx (txid , self .nodes [1 ])
8485 self .wait_for_tx (txid , self .nodes [2 ])
8586 self .reconnect_isolated_node (3 , 0 )
@@ -112,6 +113,7 @@ def run_test(self):
112113 txid = self .nodes [0 ].sendtoaddress (self .nodes [0 ].getnewaddress (), 1 )
113114 # Make sure nodes 1 and 2 received the TX before we continue,
114115 # otherwise it might announce the TX to node 3 when reconnecting
116+ self .bump_mocktime (30 )
115117 self .wait_for_tx (txid , self .nodes [1 ])
116118 self .wait_for_tx (txid , self .nodes [2 ])
117119 self .reconnect_isolated_node (3 , 0 )
@@ -150,6 +152,7 @@ def test_all_nodes_session_timeout(self, do_cycle_llmqs):
150152 txid = self .nodes [0 ].sendrawtransaction (rawtx )
151153 txid = self .nodes [3 ].sendrawtransaction (rawtx )
152154 # Make sure nodes 1 and 2 received the TX before we continue
155+ self .bump_mocktime (30 )
153156 self .wait_for_tx (txid , self .nodes [1 ])
154157 self .wait_for_tx (txid , self .nodes [2 ])
155158 # Make sure signing is done on nodes 1 and 2 (it's async)
@@ -189,6 +192,7 @@ def test_single_node_session_timeout(self, do_cycle_llmqs):
189192 self .wait_for_mnauth (self .nodes [3 ], 2 )
190193 self .nodes [0 ].sendrawtransaction (rawtx )
191194 # Make sure nodes 1 and 2 received the TX
195+ self .bump_mocktime (30 )
192196 self .wait_for_tx (txid , self .nodes [1 ])
193197 self .wait_for_tx (txid , self .nodes [2 ])
194198 self .bump_mocktime (30 )
0 commit comments