Skip to content

Commit fa3597a

Browse files
committed
fix(test): wait for monitor update before cooperative close in fee change test
Add a 2s delay after the post-fee-change payment to let LDK's internal monitor updates settle, and use the cooperative_close_by_ldk helper.
1 parent c897927 commit fa3597a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tests/common/scenarios/channel.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,12 @@ pub(crate) async fn cooperative_close_after_fee_change<E: ElectrumApi>(
270270
node.bolt11_payment().send(&parsed, None).unwrap();
271271
expect_event!(node, PaymentSuccessful);
272272

273+
// Allow time for payment state and monitor updates to fully settle
274+
// before initiating shutdown.
275+
tokio::time::sleep(Duration::from_secs(2)).await;
276+
273277
// Cooperative close
274-
let ext_node_id = peer.get_node_id().await.unwrap();
275-
node.close_channel(&user_channel_id, ext_node_id).unwrap();
276-
expect_channel_closed(node, true).await;
278+
cooperative_close_by_ldk(node, peer, bitcoind, electrs, &user_channel_id).await;
277279
}
278280

279281
/// Open a channel, mine many blocks, then force close.

0 commit comments

Comments
 (0)