From 26e67fabe6a7183c066e70d7150611b27722f5d4 Mon Sep 17 00:00:00 2001 From: daywalker90 Date: Thu, 24 Sep 2026 17:24:23 +0200 Subject: [PATCH] tests: wait for either OUR_HTLC_SUCCESS_TX in test_onchain_middleman_fulfill_after_fail The two success txs share a wallet UTXO for fee boost, so only one can be in the mempool at a time. Waiting for the first broadcast's txid could latch onto the loser and time out; wait for either instead. Changelog-None --- tests/test_closing.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_closing.py b/tests/test_closing.py index d4c678b1caf0..a6f2e9b4156f 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -2526,10 +2526,11 @@ def test_onchain_middleman_fulfill_after_fail(node_factory, bitcoind): l3.daemon.wait_for_log(' to ONCHAIN') # Now l3 learns the preimage, and spends what it's owed. + # Both HTLCs get a success tx; they share a wallet UTXO for fee boost + # so only one can enter the mempool at a time. Mine whichever gets in. l3.rpc.releasehtlc(preimage) - _, txid, _ = l3.wait_for_onchaind_tx('OUR_HTLC_SUCCESS_TX', - 'OUR_UNILATERAL/THEIR_HTLC') - bitcoind.generate_block(1, wait_for_mempool=[txid]) + l3.daemon.wait_for_logs(['Telling lightningd about OUR_HTLC_SUCCESS_TX to resolve OUR_UNILATERAL/THEIR_HTLC'] * 2) + bitcoind.generate_block(1, wait_for_mempool=1) l2.daemon.wait_for_log('THEIR_UNILATERAL/OUR_HTLC gave us preimage') # Both payments must succeed, including the one l3 said it failed.