Skip to content

Commit 76409df

Browse files
committed
f remove unnecessary error from unreachable
1 parent c109563 commit 76409df

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8850,21 +8850,18 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
88508850
match channel_entry.get_mut() {
88518851
Channel::UnfundedV2(chan) => {
88528852
if let Some(signing_session) = chan.interactive_tx_signing_session.take() {
8853-
let (channel_id, mut channel) = channel_entry.remove_entry();
8854-
if let Channel::UnfundedV2(chan) = channel {
8855-
(
8856-
channel_id,
8857-
chan.into_channel(signing_session)
8858-
.map_err(|(mut chan, err)|
8859-
convert_chan_phase_err!(self, peer_state, err, chan.context, &channel_id, UNFUNDED_CHANNEL).1
8860-
)?
8861-
)
8862-
} else {
8863-
debug_assert!(false, "The channel phase was not UnfundedV2");
8864-
let err = ChannelError::close(
8865-
"Closing due to unexpected sender error".into());
8866-
return Err(convert_chan_phase_err!(self, peer_state, err, &mut channel,
8867-
&channel_id).1)
8853+
let (channel_id, channel) = channel_entry.remove_entry();
8854+
match channel {
8855+
Channel::UnfundedV2(chan) => {
8856+
(
8857+
channel_id,
8858+
chan.into_channel(signing_session)
8859+
.map_err(|(mut chan, err)|
8860+
convert_chan_phase_err!(self, peer_state, err, chan.context, &channel_id, UNFUNDED_CHANNEL).1
8861+
)?
8862+
)
8863+
}
8864+
_ => unreachable!("The Channel variant was determined as UnfundedV2 in the outer match"),
88688865
}
88698866
} else {
88708867
return try_chan_phase_entry!(self, peer_state, Err(ChannelError::close(

0 commit comments

Comments
 (0)