Skip to content

Commit 5ec54dc

Browse files
committed
f drop excess return value from coop-close case
1 parent dfcc9e0 commit 5ec54dc

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3260,7 +3260,7 @@ macro_rules! convert_channel_err {
32603260
convert_channel_err!($self, $peer_state, reason, $funded_channel, do_close, locked_close, $channel_id, _internal);
32613261
err.dont_send_error_message();
32623262
debug_assert!(close);
3263-
(close, err)
3263+
err
32643264
} };
32653265
($self: ident, $peer_state: expr, $err: expr, $funded_channel: expr, $channel_id: expr, FUNDED_CHANNEL) => { {
32663266
let mut do_close = |reason| {
@@ -9767,7 +9767,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
97679767
// also implies there are no pending HTLCs left on the channel, so we can
97689768
// fully delete it from tracking (the channel monitor is still around to
97699769
// watch for old state broadcasts)!
9770-
let (_, err) = convert_channel_err!(self, peer_state, close_res, chan, &msg.channel_id, COOP_CLOSED);
9770+
let err = convert_channel_err!(self, peer_state, close_res, chan, &msg.channel_id, COOP_CLOSED);
97719771
chan_entry.remove();
97729772
Some((tx, Err(err)))
97739773
} else {
@@ -11053,16 +11053,17 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1105311053
Some((_, channel_id)) if chan.context().channel_id() != channel_id => None,
1105411054
_ => unblock_chan(chan, &mut peer_state.pending_msg_events),
1105511055
};
11056-
if let Some(shutdown_res) = shutdown_result {
11056+
if let Some(shutdown) = shutdown_result {
1105711057
let context = chan.context();
1105811058
let logger = WithChannelContext::from(&self.logger, context, None);
1105911059
let chan_id = context.channel_id();
1106011060
log_trace!(logger, "Removing channel {} now that the signer is unblocked", chan_id);
11061-
let (remove, err) = if let Some(funded_channel) = chan.as_funded_mut() {
11062-
convert_channel_err!(self, peer_state, shutdown_res, funded_channel, &chan_id, COOP_CLOSED)
11061+
let (remove, err) = if let Some(funded) = chan.as_funded_mut() {
11062+
let err = convert_channel_err!(self, peer_state, shutdown, funded, &chan_id, COOP_CLOSED);
11063+
(true, err)
1106311064
} else {
1106411065
debug_assert!(false);
11065-
let reason = shutdown_res.closure_reason.clone();
11066+
let reason = shutdown.closure_reason.clone();
1106611067
let err = ChannelError::Close((reason.to_string(), reason));
1106711068
convert_channel_err!(self, peer_state, err, chan, &chan_id, UNFUNDED_CHANNEL)
1106811069
};
@@ -11110,7 +11111,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
1111011111
if let Some((tx, shutdown_res)) = tx_shutdown_result_opt {
1111111112
// We're done with this channel. We got a closing_signed and sent back
1111211113
// a closing_signed with a closing transaction to broadcast.
11113-
let (_, err) = convert_channel_err!(self, peer_state, shutdown_res, funded_chan, channel_id, COOP_CLOSED);
11114+
let err = convert_channel_err!(self, peer_state, shutdown_res, funded_chan, channel_id, COOP_CLOSED);
1111411115
handle_errors.push((*cp_id, Err(err)));
1111511116

1111611117
log_info!(logger, "Broadcasting {}", log_tx!(tx));

0 commit comments

Comments
 (0)