Skip to content

Commit 027b2ea

Browse files
committed
Remove unused FundingScope argument in locked_close_channel
1 parent 080c01e commit 027b2ea

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
@@ -3004,7 +3004,7 @@ macro_rules! handle_error {
30043004
/// Note that this step can be skipped if the channel was never opened (through the creation of a
30053005
/// [`ChannelMonitor`]/channel funding transaction) to begin with.
30063006
macro_rules! locked_close_channel {
3007-
($self: ident, $peer_state: expr, $channel_context: expr, $channel_funding: expr, $shutdown_res_mut: expr) => {{
3007+
($self: ident, $peer_state: expr, $channel_context: expr, $shutdown_res_mut: expr) => {{
30083008
if let Some((_, funding_txo, _, update)) = $shutdown_res_mut.monitor_update.take() {
30093009
handle_new_monitor_update!($self, funding_txo, update, $peer_state,
30103010
$channel_context, REMAIN_LOCKED_UPDATE_ACTIONS_PROCESSED_LATER);
@@ -3052,7 +3052,7 @@ macro_rules! convert_channel_err {
30523052
let logger = WithChannelContext::from(&$self.logger, &$context, None);
30533053
log_error!(logger, "Closing channel {} due to close-required error: {}", $channel_id, msg);
30543054
let mut shutdown_res = $context.force_shutdown($funding, true, reason);
3055-
locked_close_channel!($self, $peer_state, $context, $funding, &mut shutdown_res);
3055+
locked_close_channel!($self, $peer_state, $context, &mut shutdown_res);
30563056
let err =
30573057
MsgHandleErrInternal::from_finish_shutdown(msg, *$channel_id, shutdown_res, $channel_update);
30583058
(true, err)
@@ -3117,7 +3117,7 @@ macro_rules! remove_channel_entry {
31173117
($self: ident, $peer_state: expr, $entry: expr, $shutdown_res_mut: expr) => {
31183118
{
31193119
let channel = $entry.remove_entry().1;
3120-
locked_close_channel!($self, $peer_state, &channel.context(), channel.funding(), $shutdown_res_mut);
3120+
locked_close_channel!($self, $peer_state, &channel.context(), $shutdown_res_mut);
31213121
channel
31223122
}
31233123
}
@@ -4066,7 +4066,7 @@ where
40664066
let mut peer_state = peer_state_mutex.lock().unwrap();
40674067
if let Some(mut chan) = peer_state.channel_by_id.remove(&channel_id) {
40684068
let mut close_res = chan.force_shutdown(false, ClosureReason::FundingBatchClosure);
4069-
locked_close_channel!(self, &mut *peer_state, chan.context(), chan.funding(), close_res);
4069+
locked_close_channel!(self, &mut *peer_state, chan.context(), close_res);
40704070
shutdown_results.push(close_res);
40714071
}
40724072
}
@@ -5349,7 +5349,7 @@ where
53495349
.map(|(mut chan, mut peer_state)| {
53505350
let closure_reason = ClosureReason::ProcessingError { err: e.clone() };
53515351
let mut close_res = chan.force_shutdown(false, closure_reason);
5352-
locked_close_channel!(self, peer_state, chan.context(), chan.funding(), close_res);
5352+
locked_close_channel!(self, peer_state, chan.context(), close_res);
53535353
shutdown_results.push(close_res);
53545354
peer_state.pending_msg_events.push(events::MessageSendEvent::HandleError {
53555355
node_id: counterparty_node_id,
@@ -6597,8 +6597,8 @@ where
65976597
"Force-closing pending channel with ID {} for not establishing in a timely manner",
65986598
context.channel_id());
65996599
let mut close_res = chan.force_shutdown(false, ClosureReason::HolderForceClosed { broadcasted_latest_txn: Some(false) });
6600-
let (funding, context) = chan.funding_and_context_mut();
6601-
locked_close_channel!(self, peer_state, context, funding, close_res);
6600+
let context = chan.context_mut();
6601+
locked_close_channel!(self, peer_state, context, close_res);
66026602
shutdown_channels.push(close_res);
66036603
pending_msg_events.push(MessageSendEvent::HandleError {
66046604
node_id: context.get_counterparty_node_id(),
@@ -9598,10 +9598,9 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
95989598
};
95999599
if let Some(mut shutdown_result) = shutdown_result {
96009600
let context = &chan.context();
9601-
let funding = chan.funding();
96029601
let logger = WithChannelContext::from(&self.logger, context, None);
96039602
log_trace!(logger, "Removing channel {} now that the signer is unblocked", context.channel_id());
9604-
locked_close_channel!(self, peer_state, context, funding, shutdown_result);
9603+
locked_close_channel!(self, peer_state, context, shutdown_result);
96059604
shutdown_results.push(shutdown_result);
96069605
false
96079606
} else {
@@ -9643,7 +9642,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
96439642
}
96449643
debug_assert_eq!(shutdown_result_opt.is_some(), funded_chan.is_shutdown());
96459644
if let Some(mut shutdown_result) = shutdown_result_opt {
9646-
locked_close_channel!(self, peer_state, &funded_chan.context, &funded_chan.funding, shutdown_result);
9645+
locked_close_channel!(self, peer_state, &funded_chan.context, shutdown_result);
96479646
shutdown_results.push(shutdown_result);
96489647
}
96499648
if let Some(tx) = tx_opt {
@@ -11343,7 +11342,7 @@ where
1134311342
// reorged out of the main chain. Close the channel.
1134411343
let reason_message = format!("{}", reason);
1134511344
let mut close_res = funded_channel.context.force_shutdown(&funded_channel.funding, true, reason);
11346-
locked_close_channel!(self, peer_state, &funded_channel.context, &funded_channel.funding, close_res);
11345+
locked_close_channel!(self, peer_state, &funded_channel.context, close_res);
1134711346
failed_channels.push(close_res);
1134811347
if let Ok(update) = self.get_channel_update_for_broadcast(&funded_channel) {
1134911348
let mut pending_broadcast_messages = self.pending_broadcast_messages.lock().unwrap();
@@ -11780,8 +11779,8 @@ where
1178011779
}
1178111780
// Clean up for removal.
1178211781
let mut close_res = chan.force_shutdown(false, ClosureReason::DisconnectedPeer);
11783-
let (funding, context) = chan.funding_and_context_mut();
11784-
locked_close_channel!(self, peer_state, &context, funding, close_res);
11782+
let context = chan.context_mut();
11783+
locked_close_channel!(self, peer_state, &context, close_res);
1178511784
failed_channels.push(close_res);
1178611785
false
1178711786
});

0 commit comments

Comments
 (0)