Skip to content

Commit d2b4778

Browse files
committed
Add comment describing when a completion action can be discarded
In an older PR a reviewer had asked why the discarding of a channel being blocked on another monitor update is okay if the blocked channel has since closed. At the time, this was not actually okay - the monitor updates in the channel weren't moved to the `ChannelManager` on close so the whole pipeline was busted, but with the changes in 4041f08 the handling of channel closes with pending monitor updates is now correct, and so is the existing code block.
1 parent 003fbe3 commit d2b4778

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8870,6 +8870,11 @@ where
88708870
Some((blocked_node_id, blocked_channel_outpoint, blocking_action)), ..
88718871
} = action {
88728872
if let Some(blocked_peer_state) = per_peer_state.get(&blocked_node_id) {
8873+
// If the channel we were blocking has closed, we don't need to
8874+
// worry about it - the blocked monitor update should never have
8875+
// been released from the `Channel` object so it can't have
8876+
// completed, and if the channel closed there's no reason to bother
8877+
// anymore.
88738878
blocked_peer_state.lock().unwrap().actions_blocking_raa_monitor_updates
88748879
.entry(blocked_channel_outpoint.to_channel_id())
88758880
.or_insert_with(Vec::new).push(blocking_action.clone());

0 commit comments

Comments
 (0)