@@ -24,6 +24,17 @@ 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+ def check_no_is (self , txid , node ):
28+ try :
29+ self .log .info (f"Expecting no InstantLock for { txid } " )
30+ return node .getrawtransaction (txid , True )["instantlock" ]
31+ except :
32+ return False
33+
34+ def sleep_and_check_no_is (self , txid , node , sleep ):
35+ time .sleep (sleep )
36+ return self .check_no_is (node , txid )
37+
2738 # random delay before tx is actually send by network could take up to 30 seconds
2839 def wait_for_tx (self , txid , node , expected = True , timeout = 60 ):
2940 def check_tx ():
@@ -56,7 +67,7 @@ def run_test(self):
5667 # 3 nodes should be enough to create an IS lock even if nodes 4 and 5 (which have no tx itself)
5768 # are the only "neighbours" in intra-quorum connections for one of them.
5869 self .bump_mocktime (30 )
59- self .wait_for_instantlock (txid , self .nodes [0 ], False , 5 )
70+ self .sleep_and_check_no_is (txid , self .nodes [0 ], 5 )
6071 # Have to disable ChainLocks to avoid signing a block with a "safe" tx too early
6172 self .nodes [0 ].sporkupdate ("SPORK_19_CHAINLOCKS_ENABLED" , 4000000000 )
6273 self .wait_for_sporks_same ()
@@ -94,7 +105,7 @@ def run_test(self):
94105 self .bump_mocktime (30 )
95106 self .wait_for_mnauth (self .nodes [3 ], 2 )
96107 # node 3 fully reconnected but the TX wasn't relayed to it, so there should be no IS lock
97- self .wait_for_instantlock (txid , self .nodes [0 ], False , 5 )
108+ self .sleep_and_check_no_is (txid , self .nodes [0 ], 5 )
98109 # push the tx directly via rpc
99110 self .nodes [3 ].sendrawtransaction (self .nodes [0 ].getrawtransaction (txid ))
100111 # node 3 should vote on a tx now since it became aware of it via sendrawtransaction
@@ -125,7 +136,7 @@ def run_test(self):
125136 self .bump_mocktime (30 )
126137 self .wait_for_mnauth (self .nodes [3 ], 2 )
127138 # node 3 fully reconnected but the TX wasn't relayed to it, so there should be no IS lock
128- self .wait_for_instantlock (txid , self .nodes [0 ], False , 5 )
139+ self .sleep_and_check_no_is (txid , self .nodes [0 ], 5 )
129140 # Make node0 consider the TX as safe
130141 self .bump_mocktime (10 * 60 + 1 )
131142 block = self .generate (self .nodes [0 ], 1 , sync_fun = self .no_op )[0 ]
@@ -168,19 +179,21 @@ def test_session_timeout(self, do_cycle_llmqs):
168179 self .wait_for_tx (txid_single_node , self .nodes [1 ])
169180 self .wait_for_tx (txid_single_node , self .nodes [2 ])
170181 self .bump_mocktime (30 )
182+
171183 # Make sure signing is done on nodes 1 and 2 (it's async)
172184 time .sleep (5 )
173185
174186 # node 3 fully reconnected but the signing session is already timed out, so no IS lock
175- self .wait_for_instantlock (txid_all_nodes , self .nodes [0 ], False , 5 )
176- self .wait_for_instantlock (txid_single_node , self .nodes [0 ], False , 5 )
187+ self .check_no_is (txid_all_nodes , self .nodes [0 ])
188+ self .check_no_is (txid_single_node , self .nodes [0 ])
177189 if do_cycle_llmqs :
178190 self .mine_cycle_quorum ()
179191 self .mine_cycle_quorum ()
180192 self .wait_for_chainlocked_block_all_nodes (self .nodes [0 ].getbestblockhash (), timeout = 30 )
181193
182- self .wait_for_instantlock (txid_all_nodes , self .nodes [0 ], False , 5 )
183- self .wait_for_instantlock (txid_single_node , self .nodes [0 ], False , 5 )
194+ time .sleep (5 )
195+ self .check_no_is (txid_all_nodes , self .nodes [0 ])
196+ self .check_no_is (txid_single_node , self .nodes [0 ])
184197 # Make node 0 consider the TX as safe
185198 self .bump_mocktime (10 * 60 + 1 )
186199 block = self .generate (self .nodes [0 ], 1 , sync_fun = self .no_op )[0 ]
0 commit comments