Skip to content

Commit fa4ff0c

Browse files
committed
Remove unused FundingScope argument in locked_close_channel
1 parent 2d24a89 commit fa4ff0c

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3015,7 +3015,7 @@ macro_rules! handle_error {
30153015
/// Note that this step can be skipped if the channel was never opened (through the creation of a
30163016
/// [`ChannelMonitor`]/channel funding transaction) to begin with.
30173017
macro_rules! locked_close_channel {
3018-
($self: ident, $peer_state: expr, $channel_context: expr, $channel_funding: expr, $shutdown_res_mut: expr) => {{
3018+
($self: ident, $peer_state: expr, $channel_context: expr, $shutdown_res_mut: expr) => {{
30193019
if let Some((_, funding_txo, _, update)) = $shutdown_res_mut.monitor_update.take() {
30203020
handle_new_monitor_update!($self, funding_txo, update, $peer_state,
30213021
$channel_context, REMAIN_LOCKED_UPDATE_ACTIONS_PROCESSED_LATER);
@@ -3063,7 +3063,7 @@ macro_rules! convert_channel_err {
30633063
let logger = WithChannelContext::from(&$self.logger, &$context, None);
30643064
log_error!(logger, "Closing channel {} due to close-required error: {}", $channel_id, msg);
30653065
let mut shutdown_res = $context.force_shutdown($funding, true, reason);
3066-
locked_close_channel!($self, $peer_state, $context, $funding, &mut shutdown_res);
3066+
locked_close_channel!($self, $peer_state, $context, &mut shutdown_res);
30673067
let err =
30683068
MsgHandleErrInternal::from_finish_shutdown(msg, *$channel_id, shutdown_res, $channel_update);
30693069
(true, err)
@@ -3128,7 +3128,7 @@ macro_rules! remove_channel_entry {
31283128
($self: ident, $peer_state: expr, $entry: expr, $shutdown_res_mut: expr) => {
31293129
{
31303130
let channel = $entry.remove_entry().1;
3131-
locked_close_channel!($self, $peer_state, &channel.context(), channel.funding(), $shutdown_res_mut);
3131+
locked_close_channel!($self, $peer_state, &channel.context(), $shutdown_res_mut);
31323132
channel
31333133
}
31343134
}
@@ -4077,7 +4077,7 @@ where
40774077
let mut peer_state = peer_state_mutex.lock().unwrap();
40784078
if let Some(mut chan) = peer_state.channel_by_id.remove(&channel_id) {
40794079
let mut close_res = chan.force_shutdown(false, ClosureReason::FundingBatchClosure);
4080-
locked_close_channel!(self, &mut *peer_state, chan.context(), chan.funding(), close_res);
4080+
locked_close_channel!(self, &mut *peer_state, chan.context(), close_res);
40814081
shutdown_results.push(close_res);
40824082
}
40834083
}
@@ -5376,7 +5376,7 @@ where
53765376
.map(|(mut chan, mut peer_state)| {
53775377
let closure_reason = ClosureReason::ProcessingError { err: e.clone() };
53785378
let mut close_res = chan.force_shutdown(false, closure_reason);
5379-
locked_close_channel!(self, peer_state, chan.context(), chan.funding(), close_res);
5379+
locked_close_channel!(self, peer_state, chan.context(), close_res);
53805380
shutdown_results.push(close_res);
53815381
peer_state.pending_msg_events.push(MessageSendEvent::HandleError {
53825382
node_id: counterparty_node_id,
@@ -6624,8 +6624,8 @@ where
66246624
"Force-closing pending channel with ID {} for not establishing in a timely manner",
66256625
context.channel_id());
66266626
let mut close_res = chan.force_shutdown(false, ClosureReason::HolderForceClosed { broadcasted_latest_txn: Some(false) });
6627-
let (funding, context) = chan.funding_and_context_mut();
6628-
locked_close_channel!(self, peer_state, context, funding, close_res);
6627+
let context = chan.context_mut();
6628+
locked_close_channel!(self, peer_state, context, close_res);
66296629
shutdown_channels.push(close_res);
66306630
pending_msg_events.push(MessageSendEvent::HandleError {
66316631
node_id: context.get_counterparty_node_id(),
@@ -9625,10 +9625,9 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
96259625
};
96269626
if let Some(mut shutdown_result) = shutdown_result {
96279627
let context = &chan.context();
9628-
let funding = chan.funding();
96299628
let logger = WithChannelContext::from(&self.logger, context, None);
96309629
log_trace!(logger, "Removing channel {} now that the signer is unblocked", context.channel_id());
9631-
locked_close_channel!(self, peer_state, context, funding, shutdown_result);
9630+
locked_close_channel!(self, peer_state, context, shutdown_result);
96329631
shutdown_results.push(shutdown_result);
96339632
false
96349633
} else {
@@ -9670,7 +9669,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
96709669
}
96719670
debug_assert_eq!(shutdown_result_opt.is_some(), funded_chan.is_shutdown());
96729671
if let Some(mut shutdown_result) = shutdown_result_opt {
9673-
locked_close_channel!(self, peer_state, &funded_chan.context, &funded_chan.funding, shutdown_result);
9672+
locked_close_channel!(self, peer_state, &funded_chan.context, shutdown_result);
96749673
shutdown_results.push(shutdown_result);
96759674
}
96769675
if let Some(tx) = tx_opt {
@@ -11012,8 +11011,8 @@ where
1101211011
}
1101311012
// Clean up for removal.
1101411013
let mut close_res = chan.force_shutdown(false, ClosureReason::DisconnectedPeer);
11015-
let (funding, context) = chan.funding_and_context_mut();
11016-
locked_close_channel!(self, peer_state, &context, funding, close_res);
11014+
let context = chan.context_mut();
11015+
locked_close_channel!(self, peer_state, &context, close_res);
1101711016
failed_channels.push(close_res);
1101811017
false
1101911018
});
@@ -11583,7 +11582,7 @@ where
1158311582
// reorged out of the main chain. Close the channel.
1158411583
let reason_message = format!("{}", reason);
1158511584
let mut close_res = funded_channel.context.force_shutdown(&funded_channel.funding, true, reason);
11586-
locked_close_channel!(self, peer_state, &funded_channel.context, &funded_channel.funding, close_res);
11585+
locked_close_channel!(self, peer_state, &funded_channel.context, close_res);
1158711586
failed_channels.push(close_res);
1158811587
if let Ok(update) = self.get_channel_update_for_broadcast(&funded_channel) {
1158911588
let mut pending_broadcast_messages = self.pending_broadcast_messages.lock().unwrap();

0 commit comments

Comments
 (0)