Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tests/test_closing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe wait on the type-specific onchaind line instead, such as ['Telling lightningd about OUR_HTLC_SUCCESS_TX to resolve OUR_UNILATERAL/THEIR_HTLC'] * 2. That is the same line wait_for_onchaind_txs uses. Then collect the broadcast txids?

'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.
Expand Down
Loading