@@ -3004,7 +3004,7 @@ macro_rules! handle_error {
3004
3004
/// Note that this step can be skipped if the channel was never opened (through the creation of a
3005
3005
/// [`ChannelMonitor`]/channel funding transaction) to begin with.
3006
3006
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) => {{
3008
3008
if let Some((_, funding_txo, _, update)) = $shutdown_res_mut.monitor_update.take() {
3009
3009
handle_new_monitor_update!($self, funding_txo, update, $peer_state,
3010
3010
$channel_context, REMAIN_LOCKED_UPDATE_ACTIONS_PROCESSED_LATER);
@@ -3052,7 +3052,7 @@ macro_rules! convert_channel_err {
3052
3052
let logger = WithChannelContext::from(&$self.logger, &$context, None);
3053
3053
log_error!(logger, "Closing channel {} due to close-required error: {}", $channel_id, msg);
3054
3054
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);
3056
3056
let err =
3057
3057
MsgHandleErrInternal::from_finish_shutdown(msg, *$channel_id, shutdown_res, $channel_update);
3058
3058
(true, err)
@@ -3117,7 +3117,7 @@ macro_rules! remove_channel_entry {
3117
3117
($self: ident, $peer_state: expr, $entry: expr, $shutdown_res_mut: expr) => {
3118
3118
{
3119
3119
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);
3121
3121
channel
3122
3122
}
3123
3123
}
@@ -4066,7 +4066,7 @@ where
4066
4066
let mut peer_state = peer_state_mutex.lock().unwrap();
4067
4067
if let Some(mut chan) = peer_state.channel_by_id.remove(&channel_id) {
4068
4068
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);
4070
4070
shutdown_results.push(close_res);
4071
4071
}
4072
4072
}
@@ -5349,7 +5349,7 @@ where
5349
5349
.map(|(mut chan, mut peer_state)| {
5350
5350
let closure_reason = ClosureReason::ProcessingError { err: e.clone() };
5351
5351
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);
5353
5353
shutdown_results.push(close_res);
5354
5354
peer_state.pending_msg_events.push(events::MessageSendEvent::HandleError {
5355
5355
node_id: counterparty_node_id,
@@ -6597,8 +6597,8 @@ where
6597
6597
"Force-closing pending channel with ID {} for not establishing in a timely manner",
6598
6598
context.channel_id());
6599
6599
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);
6602
6602
shutdown_channels.push(close_res);
6603
6603
pending_msg_events.push(MessageSendEvent::HandleError {
6604
6604
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/
9598
9598
};
9599
9599
if let Some(mut shutdown_result) = shutdown_result {
9600
9600
let context = &chan.context();
9601
- let funding = chan.funding();
9602
9601
let logger = WithChannelContext::from(&self.logger, context, None);
9603
9602
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);
9605
9604
shutdown_results.push(shutdown_result);
9606
9605
false
9607
9606
} else {
@@ -9643,7 +9642,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
9643
9642
}
9644
9643
debug_assert_eq!(shutdown_result_opt.is_some(), funded_chan.is_shutdown());
9645
9644
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);
9647
9646
shutdown_results.push(shutdown_result);
9648
9647
}
9649
9648
if let Some(tx) = tx_opt {
@@ -11343,7 +11342,7 @@ where
11343
11342
// reorged out of the main chain. Close the channel.
11344
11343
let reason_message = format!("{}", reason);
11345
11344
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);
11347
11346
failed_channels.push(close_res);
11348
11347
if let Ok(update) = self.get_channel_update_for_broadcast(&funded_channel) {
11349
11348
let mut pending_broadcast_messages = self.pending_broadcast_messages.lock().unwrap();
@@ -11780,8 +11779,8 @@ where
11780
11779
}
11781
11780
// Clean up for removal.
11782
11781
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);
11785
11784
failed_channels.push(close_res);
11786
11785
false
11787
11786
});
0 commit comments