Skip to content

Commit dea37db

Browse files
committed
f map_err
1 parent bceca1e commit dea37db

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6170,14 +6170,11 @@ where
61706170

61716171
// If we're doing manual acceptance checks on the channel, then defer creation until we're sure we want to accept.
61726172
if self.default_configuration.manually_accept_inbound_channels {
6173-
let channel_type_res = channel::channel_type_from_open_channel(
6174-
&msg, &peer_state.latest_features, &self.channel_type_features()
6175-
);
6176-
let channel_type = match channel_type_res {
6177-
Ok(channel_type) => channel_type,
6178-
Err(e) =>
6179-
return Err(MsgHandleErrInternal::from_chan_no_close(e, msg.temporary_channel_id)),
6180-
};
6173+
let channel_type = channel::channel_type_from_open_channel(
6174+
&msg, &peer_state.latest_features, &self.channel_type_features()
6175+
).map_err(|e|
6176+
MsgHandleErrInternal::from_chan_no_close(e, msg.temporary_channel_id)
6177+
)?;
61816178
let mut pending_events = self.pending_events.lock().unwrap();
61826179
pending_events.push_back((events::Event::OpenChannelRequest {
61836180
temporary_channel_id: msg.temporary_channel_id.clone(),

0 commit comments

Comments
 (0)