]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Remove unreachable BroadcastChannelUpdate
authorJeffrey Czyz <jkczyz@gmail.com>
Mon, 9 Aug 2021 20:15:12 +0000 (15:15 -0500)
committerJeffrey Czyz <jkczyz@gmail.com>
Mon, 9 Aug 2021 20:56:10 +0000 (15:56 -0500)
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

index 9465c82ea5d1224aafcdf45943e563de403b7b10..afe3f91dd2def716b2af972eb992124f57420bcf 100644 (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(());
                                },
                                hash_map::Entry::Vacant(_) => return Err(MsgHandleErrInternal::send_err_msg_no_close("Failed to find corresponding channel".to_owned(), msg.channel_id))