From: Jeffrey Czyz Date: Mon, 9 Aug 2021 20:15:12 +0000 (-0500) Subject: Remove unreachable BroadcastChannelUpdate X-Git-Tag: v0.0.100~7^2~3 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=f1c07b5573a75b00f178c4d8c2a637e29d5acaa6;p=rust-lightning 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. --- 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))