From f1c07b5573a75b00f178c4d8c2a637e29d5acaa6 Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Mon, 9 Aug 2021 15:15:12 -0500 Subject: [PATCH] Remove unreachable BroadcastChannelUpdate When handling shutdown messages, Channel cannot move to ChannelState::ShutdownComplete. Remove the code in ChannelManager that adds a MessageSendEvent::BroadcastChannelUpdate in this case since it is unreachable. --- lightning/src/ln/channelmanager.rs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 9465c82ea..afe3f91dd 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -3271,15 +3271,6 @@ impl ChannelMana }); } - if chan_entry.get().is_shutdown() { - let channel = remove_channel!(channel_state, chan_entry); - if let Ok(channel_update) = self.get_channel_update_for_broadcast(&channel) { - channel_state.pending_msg_events.push(events::MessageSendEvent::BroadcastChannelUpdate { - msg: channel_update - }); - } - } - break Ok(()); }, hash_map::Entry::Vacant(_) => return Err(MsgHandleErrInternal::send_err_msg_no_close("Failed to find corresponding channel".to_owned(), msg.channel_id)) -- 2.39.5