Skip to content

Commit 5d8cd5a

Browse files
committed
Fix debug assertion on opening a channel with a disconnected peer
If we try to open a channel with a peer that is disconnected (but with which we have some other channels), we'll end up with an unfunded channel which will lead to a panic when the peer reconnects. Here we drop this debug assertion without bother to add a new test, given this behavior will change in a PR very soon.
1 parent c946edb commit 5d8cd5a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8979,13 +8979,7 @@ where
89798979
let pending_msg_events = &mut peer_state.pending_msg_events;
89808980

89818981
peer_state.channel_by_id.iter_mut().filter_map(|(_, phase)|
8982-
if let ChannelPhase::Funded(chan) = phase { Some(chan) } else {
8983-
// Since unfunded channel maps are cleared upon disconnecting a peer, and they're not persisted
8984-
// (so won't be recovered after a crash), they shouldn't exist here and we would never need to
8985-
// worry about closing and removing them.
8986-
debug_assert!(false);
8987-
None
8988-
}
8982+
if let ChannelPhase::Funded(chan) = phase { Some(chan) } else { None }
89898983
).for_each(|chan| {
89908984
let logger = WithChannelContext::from(&self.logger, &chan.context);
89918985
pending_msg_events.push(events::MessageSendEvent::SendChannelReestablish {

0 commit comments

Comments
 (0)