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.
This commit is contained in:
Jeffrey Czyz 2021-08-09 15:15:12 -05:00
parent ecb0b84241
commit f1c07b5573
No known key found for this signature in database
GPG key ID: 3A4E08275D5E96D2

View file

@ -3271,15 +3271,6 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> 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(()); break Ok(());
}, },
hash_map::Entry::Vacant(_) => return Err(MsgHandleErrInternal::send_err_msg_no_close("Failed to find corresponding channel".to_owned(), msg.channel_id)) hash_map::Entry::Vacant(_) => return Err(MsgHandleErrInternal::send_err_msg_no_close("Failed to find corresponding channel".to_owned(), msg.channel_id))