@@ -3002,7 +3002,7 @@ macro_rules! handle_error {
3002
3002
/// Note that this step can be skipped if the channel was never opened (through the creation of a
3003
3003
/// [`ChannelMonitor`]/channel funding transaction) to begin with.
3004
3004
macro_rules! locked_close_channel {
3005
- ($self: ident, $peer_state: expr, $channel_context: expr, $channel_funding: expr, $ shutdown_res_mut: expr) => {{
3005
+ ($self: ident, $peer_state: expr, $channel_context: expr, $shutdown_res_mut: expr) => {{
3006
3006
if let Some((_, funding_txo, _, update)) = $shutdown_res_mut.monitor_update.take() {
3007
3007
handle_new_monitor_update!($self, funding_txo, update, $peer_state,
3008
3008
$channel_context, REMAIN_LOCKED_UPDATE_ACTIONS_PROCESSED_LATER);
@@ -3050,7 +3050,7 @@ macro_rules! convert_channel_err {
3050
3050
let logger = WithChannelContext::from(&$self.logger, &$context, None);
3051
3051
log_error!(logger, "Closing channel {} due to close-required error: {}", $channel_id, msg);
3052
3052
let mut shutdown_res = $context.force_shutdown($funding, true, reason);
3053
- locked_close_channel!($self, $peer_state, $context, $funding, &mut shutdown_res);
3053
+ locked_close_channel!($self, $peer_state, $context, &mut shutdown_res);
3054
3054
let err =
3055
3055
MsgHandleErrInternal::from_finish_shutdown(msg, *$channel_id, shutdown_res, $channel_update);
3056
3056
(true, err)
@@ -3115,7 +3115,7 @@ macro_rules! remove_channel_entry {
3115
3115
($self: ident, $peer_state: expr, $entry: expr, $shutdown_res_mut: expr) => {
3116
3116
{
3117
3117
let channel = $entry.remove_entry().1;
3118
- locked_close_channel!($self, $peer_state, &channel.context(), channel.funding(), $shutdown_res_mut);
3118
+ locked_close_channel!($self, $peer_state, &channel.context(), $shutdown_res_mut);
3119
3119
channel
3120
3120
}
3121
3121
}
@@ -4064,7 +4064,7 @@ where
4064
4064
let mut peer_state = peer_state_mutex.lock().unwrap();
4065
4065
if let Some(mut chan) = peer_state.channel_by_id.remove(&channel_id) {
4066
4066
let mut close_res = chan.force_shutdown(false, ClosureReason::FundingBatchClosure);
4067
- locked_close_channel!(self, &mut *peer_state, chan.context(), chan.funding(), close_res);
4067
+ locked_close_channel!(self, &mut *peer_state, chan.context(), close_res);
4068
4068
shutdown_results.push(close_res);
4069
4069
}
4070
4070
}
@@ -5348,7 +5348,7 @@ where
5348
5348
.map(|(mut chan, mut peer_state)| {
5349
5349
let closure_reason = ClosureReason::ProcessingError { err: e.clone() };
5350
5350
let mut close_res = chan.force_shutdown(false, closure_reason);
5351
- locked_close_channel!(self, peer_state, chan.context(), chan.funding(), close_res);
5351
+ locked_close_channel!(self, peer_state, chan.context(), close_res);
5352
5352
shutdown_results.push(close_res);
5353
5353
peer_state.pending_msg_events.push(events::MessageSendEvent::HandleError {
5354
5354
node_id: counterparty_node_id,
@@ -6596,8 +6596,8 @@ where
6596
6596
"Force-closing pending channel with ID {} for not establishing in a timely manner",
6597
6597
context.channel_id());
6598
6598
let mut close_res = chan.force_shutdown(false, ClosureReason::HolderForceClosed { broadcasted_latest_txn: Some(false) });
6599
- let (funding, context) = chan.funding_and_context_mut ();
6600
- locked_close_channel!(self, peer_state, context, funding, close_res);
6599
+ let context = chan.context_mut ();
6600
+ locked_close_channel!(self, peer_state, context, close_res);
6601
6601
shutdown_channels.push(close_res);
6602
6602
pending_msg_events.push(MessageSendEvent::HandleError {
6603
6603
node_id: context.get_counterparty_node_id(),
@@ -9597,10 +9597,9 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
9597
9597
};
9598
9598
if let Some(mut shutdown_result) = shutdown_result {
9599
9599
let context = &chan.context();
9600
- let funding = chan.funding();
9601
9600
let logger = WithChannelContext::from(&self.logger, context, None);
9602
9601
log_trace!(logger, "Removing channel {} now that the signer is unblocked", context.channel_id());
9603
- locked_close_channel!(self, peer_state, context, funding, shutdown_result);
9602
+ locked_close_channel!(self, peer_state, context, shutdown_result);
9604
9603
shutdown_results.push(shutdown_result);
9605
9604
false
9606
9605
} else {
@@ -9642,7 +9641,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
9642
9641
}
9643
9642
debug_assert_eq!(shutdown_result_opt.is_some(), funded_chan.is_shutdown());
9644
9643
if let Some(mut shutdown_result) = shutdown_result_opt {
9645
- locked_close_channel!(self, peer_state, &funded_chan.context, &funded_chan.funding, shutdown_result);
9644
+ locked_close_channel!(self, peer_state, &funded_chan.context, shutdown_result);
9646
9645
shutdown_results.push(shutdown_result);
9647
9646
}
9648
9647
if let Some(tx) = tx_opt {
@@ -11342,7 +11341,7 @@ where
11342
11341
// reorged out of the main chain. Close the channel.
11343
11342
let reason_message = format!("{}", reason);
11344
11343
let mut close_res = funded_channel.context.force_shutdown(&funded_channel.funding, true, reason);
11345
- locked_close_channel!(self, peer_state, &funded_channel.context, &funded_channel.funding, close_res);
11344
+ locked_close_channel!(self, peer_state, &funded_channel.context, close_res);
11346
11345
failed_channels.push(close_res);
11347
11346
if let Ok(update) = self.get_channel_update_for_broadcast(&funded_channel) {
11348
11347
let mut pending_broadcast_messages = self.pending_broadcast_messages.lock().unwrap();
@@ -11779,8 +11778,8 @@ where
11779
11778
}
11780
11779
// Clean up for removal.
11781
11780
let mut close_res = chan.force_shutdown(false, ClosureReason::DisconnectedPeer);
11782
- let (funding, context) = chan.funding_and_context_mut ();
11783
- locked_close_channel!(self, peer_state, &context, funding, close_res);
11781
+ let context = chan.context_mut ();
11782
+ locked_close_channel!(self, peer_state, &context, close_res);
11784
11783
failed_channels.push(close_res);
11785
11784
false
11786
11785
});
0 commit comments