Skip to content

Commit 341e8e4

Browse files
authored
Merge pull request #4094 from TheBlueMatt/2025-09-no-disconnected-msgs
Stop enqueueing messages for disconnected peers
2 parents 1ed6c4b + 47a3e5c commit 341e8e4

File tree

7 files changed

+214
-149
lines changed

7 files changed

+214
-149
lines changed

lightning/src/ln/chanmon_update_fail_tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3897,7 +3897,7 @@ fn do_test_durable_preimages_on_closed_channel(
38973897
}
38983898
}
38993899
if !close_chans_before_reload {
3900-
check_closed_broadcast(&nodes[1], 1, true);
3900+
check_closed_broadcast(&nodes[1], 1, false);
39013901
let reason = ClosureReason::CommitmentTxConfirmed;
39023902
check_closed_event(&nodes[1], 1, reason, false, &[node_a_id], 100000);
39033903
}
@@ -3914,7 +3914,7 @@ fn do_test_durable_preimages_on_closed_channel(
39143914
check_spends!(bs_preimage_tx, as_closing_tx[0]);
39153915

39163916
mine_transactions(&nodes[0], &[&as_closing_tx[0], bs_preimage_tx]);
3917-
check_closed_broadcast(&nodes[0], 1, true);
3917+
check_closed_broadcast(&nodes[0], 1, false);
39183918
expect_payment_sent(&nodes[0], payment_preimage, None, true, true);
39193919

39203920
if !close_chans_before_reload || close_only_a {
@@ -4063,7 +4063,7 @@ fn do_test_reload_mon_update_completion_actions(close_during_reload: bool) {
40634063
Event::ChannelClosed { .. } => {},
40644064
_ => panic!(),
40654065
}
4066-
check_closed_broadcast!(nodes[1], true);
4066+
check_closed_broadcast(&nodes[1], 1, false);
40674067
}
40684068

40694069
// Once we run event processing the monitor should free, check that it was indeed the B<->C

lightning/src/ln/channel.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3886,6 +3886,12 @@ where
38863886
self.is_usable() && !self.channel_state.is_peer_disconnected()
38873887
}
38883888

3889+
/// Returns true if the peer for this channel is currently connected and we're not waiting on
3890+
/// `channel_reestablish` messages to re-init the channel.
3891+
pub fn is_connected(&self) -> bool {
3892+
!self.channel_state.is_peer_disconnected()
3893+
}
3894+
38893895
/// Returns false if our last broadcasted channel_update message has the "channel disabled" bit set
38903896
pub fn is_enabled(&self) -> bool {
38913897
self.is_usable()

0 commit comments

Comments
 (0)