From 857d36344dbfc4d36aa39b76677556cd10df0c6a Mon Sep 17 00:00:00 2001 From: Matt Morehouse Date: Tue, 26 Nov 2024 10:35:44 -0600 Subject: [PATCH] Correct return value for apply_post_close_monitor_update A recent change accidentally inverted the returned monitor update for the case where an update is applied after the channel has been closed. This commit corrects that mistake. --- lightning/src/ln/channelmanager.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 86faeac9a68..12b641ae891 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -3866,9 +3866,9 @@ where match peer_state.channel_by_id.entry(channel_id) { hash_map::Entry::Occupied(mut chan_phase) => { if let ChannelPhase::Funded(chan) = chan_phase.get_mut() { - let in_flight = handle_new_monitor_update!(self, funding_txo, + let completed = handle_new_monitor_update!(self, funding_txo, monitor_update, peer_state_lock, peer_state, per_peer_state, chan); - return if in_flight { ChannelMonitorUpdateStatus::InProgress } else { ChannelMonitorUpdateStatus::Completed }; + return if completed { ChannelMonitorUpdateStatus::Completed } else { ChannelMonitorUpdateStatus::InProgress }; } else { debug_assert!(false, "We shouldn't have an update for a non-funded channel"); }