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.