@@ -3015,7 +3015,7 @@ macro_rules! handle_error {
3015
3015
/// Note that this step can be skipped if the channel was never opened (through the creation of a
3016
3016
/// [`ChannelMonitor`]/channel funding transaction) to begin with.
3017
3017
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) => {{
3019
3019
if let Some((_, funding_txo, _, update)) = $shutdown_res_mut.monitor_update.take() {
3020
3020
handle_new_monitor_update!($self, funding_txo, update, $peer_state,
3021
3021
$channel_context, REMAIN_LOCKED_UPDATE_ACTIONS_PROCESSED_LATER);
@@ -3063,7 +3063,7 @@ macro_rules! convert_channel_err {
3063
3063
let logger = WithChannelContext::from(&$self.logger, &$context, None);
3064
3064
log_error!(logger, "Closing channel {} due to close-required error: {}", $channel_id, msg);
3065
3065
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);
3067
3067
let err =
3068
3068
MsgHandleErrInternal::from_finish_shutdown(msg, *$channel_id, shutdown_res, $channel_update);
3069
3069
(true, err)
@@ -3128,7 +3128,7 @@ macro_rules! remove_channel_entry {
3128
3128
($self: ident, $peer_state: expr, $entry: expr, $shutdown_res_mut: expr) => {
3129
3129
{
3130
3130
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);
3132
3132
channel
3133
3133
}
3134
3134
}
@@ -4077,7 +4077,7 @@ where
4077
4077
let mut peer_state = peer_state_mutex.lock().unwrap();
4078
4078
if let Some(mut chan) = peer_state.channel_by_id.remove(&channel_id) {
4079
4079
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);
4081
4081
shutdown_results.push(close_res);
4082
4082
}
4083
4083
}
@@ -5376,7 +5376,7 @@ where
5376
5376
.map(|(mut chan, mut peer_state)| {
5377
5377
let closure_reason = ClosureReason::ProcessingError { err: e.clone() };
5378
5378
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);
5380
5380
shutdown_results.push(close_res);
5381
5381
peer_state.pending_msg_events.push(MessageSendEvent::HandleError {
5382
5382
node_id: counterparty_node_id,
@@ -6624,8 +6624,8 @@ where
6624
6624
"Force-closing pending channel with ID {} for not establishing in a timely manner",
6625
6625
context.channel_id());
6626
6626
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);
6629
6629
shutdown_channels.push(close_res);
6630
6630
pending_msg_events.push(MessageSendEvent::HandleError {
6631
6631
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/
9625
9625
};
9626
9626
if let Some(mut shutdown_result) = shutdown_result {
9627
9627
let context = &chan.context();
9628
- let funding = chan.funding();
9629
9628
let logger = WithChannelContext::from(&self.logger, context, None);
9630
9629
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);
9632
9631
shutdown_results.push(shutdown_result);
9633
9632
false
9634
9633
} else {
@@ -9670,7 +9669,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
9670
9669
}
9671
9670
debug_assert_eq!(shutdown_result_opt.is_some(), funded_chan.is_shutdown());
9672
9671
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);
9674
9673
shutdown_results.push(shutdown_result);
9675
9674
}
9676
9675
if let Some(tx) = tx_opt {
@@ -11012,8 +11011,8 @@ where
11012
11011
}
11013
11012
// Clean up for removal.
11014
11013
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);
11017
11016
failed_channels.push(close_res);
11018
11017
false
11019
11018
});
@@ -11583,7 +11582,7 @@ where
11583
11582
// reorged out of the main chain. Close the channel.
11584
11583
let reason_message = format!("{}", reason);
11585
11584
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);
11587
11586
failed_channels.push(close_res);
11588
11587
if let Ok(update) = self.get_channel_update_for_broadcast(&funded_channel) {
11589
11588
let mut pending_broadcast_messages = self.pending_broadcast_messages.lock().unwrap();
0 commit comments