Skip to content

Commit

Permalink
f map_err
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed Jan 8, 2024
1 parent bceca1e commit dea37db
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit dea37db

Please sign in to comment.