Skip to content

Commit aba57bb

Browse files
committed
Make test_durable_preimages_on_closed_channel more robust
Makes `test_durable_preimages_on_closed_channel` more robust against changes to the order in which transactions are broadcast.
1 parent 2d6720e commit aba57bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/ln/chanmon_update_fail_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3288,7 +3288,7 @@ fn do_test_durable_preimages_on_closed_channel(close_chans_before_reload: bool,
32883288
// Finally, check that B created a payment preimage transaction and close out the payment.
32893289
let bs_txn = nodes[1].tx_broadcaster.txn_broadcasted.lock().unwrap().split_off(0);
32903290
assert_eq!(bs_txn.len(), if close_chans_before_reload && !close_only_a { 2 } else { 1 });
3291-
let bs_preimage_tx = &bs_txn[0];
3291+
let bs_preimage_tx = bs_txn.iter().find(|tx| tx.input[0].previous_output.txid == as_closing_tx[0].compute_txid()).unwrap();
32923292
check_spends!(bs_preimage_tx, as_closing_tx[0]);
32933293

32943294
if !close_chans_before_reload {

0 commit comments

Comments
 (0)