diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 5efef2e904b..8e0ac2fdf08 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -6170,14 +6170,11 @@ where // If we're doing manual acceptance checks on the channel, then defer creation until we're sure we want to accept. if self.default_configuration.manually_accept_inbound_channels { - let channel_type_res = channel::channel_type_from_open_channel( - &msg, &peer_state.latest_features, &self.channel_type_features() - ); - let channel_type = match channel_type_res { - Ok(channel_type) => channel_type, - Err(e) => - return Err(MsgHandleErrInternal::from_chan_no_close(e, msg.temporary_channel_id)), - }; + let channel_type = channel::channel_type_from_open_channel( + &msg, &peer_state.latest_features, &self.channel_type_features() + ).map_err(|e| + MsgHandleErrInternal::from_chan_no_close(e, msg.temporary_channel_id) + )?; let mut pending_events = self.pending_events.lock().unwrap(); pending_events.push_back((events::Event::OpenChannelRequest { temporary_channel_id: msg.temporary_channel_id.clone(),