Skip to content

Commit a0e4260

Browse files
UdjinM6claude
andcommitted
test: address review — fix additional IS lock sync sites and remove dead code
Add sync_mempools() to two more tests with the same vulnerable pattern: - feature_llmq_is_cl_conflicts.py: no whitelist, waits on all nodes - interface_zmq_dash.py: three locations (low risk due to whitelist, but fixed for consistency) Remove dead wait_for_tx() method from feature_llmq_is_retroactive.py whose call sites were all replaced with sync_mempools in the prior commit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 62d47f7 commit a0e4260

3 files changed

Lines changed: 4 additions & 10 deletions

File tree

test/functional/feature_llmq_is_cl_conflicts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ def test_chainlock_overrides_islock_overrides_nonchainlock(self):
244244
self.nodes[0].sendrawtransaction(rawtx2)
245245
# bump mocktime to force tx relay
246246
self.bump_mocktime(60)
247+
self.sync_mempools()
247248
for node in self.nodes:
248249
self.wait_for_instantlock(rawtx2_txid, node)
249250

test/functional/feature_llmq_is_retroactive.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,6 @@ def sleep_and_assert_no_instantlock(self, txid, node, sleep=5):
3535
time.sleep(sleep)
3636
self.assert_no_instantlock(txid, node)
3737

38-
# random delay before tx is actually send by network could take up to 30 seconds
39-
def wait_for_tx(self, txid, node, expected=True, timeout=60):
40-
def check_tx():
41-
try:
42-
return node.getrawtransaction(txid)
43-
except Exception:
44-
return False
45-
if self.wait_until(check_tx, timeout=timeout, do_assert=expected) and not expected:
46-
raise AssertionError("waiting unexpectedly succeeded")
47-
4838
def create_fund_sign_tx(self):
4939
rawtx = self.nodes[0].createrawtransaction([], {self.nodes[0].getnewaddress(): 1})
5040
rawtx = self.nodes[0].fundrawtransaction(rawtx)['hex']

test/functional/interface_zmq_dash.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ def test_instantsend_publishers(self):
297297
# Send the first transaction and wait for the InstantLock
298298
rpc_raw_tx_1_hash = self.nodes[0].sendrawtransaction(rpc_raw_tx_1['hex'])
299299
self.bump_mocktime(30)
300+
self.sync_mempools()
300301
self.wait_for_instantlock(rpc_raw_tx_1_hash, self.nodes[0])
301302
# Validate hashtxlock
302303
zmq_tx_lock_hash = self.subscribers[ZMQPublisher.hash_tx_lock].receive().read(32).hex()
@@ -350,6 +351,7 @@ def test_instantsend_publishers(self):
350351
# Now send the tx itself
351352
self.test_node.send_tx(from_hex(msg_tx(),rpc_raw_tx_3['hex']))
352353
self.bump_mocktime(30)
354+
self.sync_mempools()
353355
self.wait_for_instantlock(rpc_raw_tx_3['txid'], self.nodes[0])
354356
# Validate hashtxlock
355357
zmq_tx_lock_hash = self.subscribers[ZMQPublisher.hash_tx_lock].receive().read(32).hex()
@@ -384,6 +386,7 @@ def test_governance_publishers(self):
384386
proposal_hex = ''.join(format(x, '02x') for x in json.dumps(proposal_data).encode())
385387
collateral = self.nodes[0].gobject("prepare", "0", proposal_rev, proposal_time, proposal_hex)
386388
self.bump_mocktime(30)
389+
self.sync_mempools()
387390
self.wait_for_instantlock(collateral, self.nodes[0])
388391
self.generate(self.nodes[0], 6, sync_fun=lambda: self.sync_blocks())
389392
rpc_proposal_hash = self.nodes[0].gobject("submit", "0", proposal_rev, proposal_time, proposal_hex, collateral)

0 commit comments

Comments
 (0)