@@ -3007,7 +3007,7 @@ macro_rules! handle_error {
3007
3007
/// Note that this step can be skipped if the channel was never opened (through the creation of a
3008
3008
/// [`ChannelMonitor`]/channel funding transaction) to begin with.
3009
3009
macro_rules! locked_close_channel {
3010
- ($self: ident, $peer_state: expr, $channel_context: expr, $channel_funding: expr, $ shutdown_res_mut: expr) => {{
3010
+ ($self: ident, $peer_state: expr, $channel_context: expr, $shutdown_res_mut: expr) => {{
3011
3011
if let Some((_, funding_txo, _, update)) = $shutdown_res_mut.monitor_update.take() {
3012
3012
handle_new_monitor_update!($self, funding_txo, update, $peer_state,
3013
3013
$channel_context, REMAIN_LOCKED_UPDATE_ACTIONS_PROCESSED_LATER);
@@ -3055,7 +3055,7 @@ macro_rules! convert_channel_err {
3055
3055
let logger = WithChannelContext::from(&$self.logger, &$context, None);
3056
3056
log_error!(logger, "Closing channel {} due to close-required error: {}", $channel_id, msg);
3057
3057
let mut shutdown_res = $context.force_shutdown($funding, true, reason);
3058
- locked_close_channel!($self, $peer_state, $context, $funding, &mut shutdown_res);
3058
+ locked_close_channel!($self, $peer_state, $context, &mut shutdown_res);
3059
3059
let err =
3060
3060
MsgHandleErrInternal::from_finish_shutdown(msg, *$channel_id, shutdown_res, $channel_update);
3061
3061
(true, err)
@@ -3120,7 +3120,7 @@ macro_rules! remove_channel_entry {
3120
3120
($self: ident, $peer_state: expr, $entry: expr, $shutdown_res_mut: expr) => {
3121
3121
{
3122
3122
let channel = $entry.remove_entry().1;
3123
- locked_close_channel!($self, $peer_state, &channel.context(), channel.funding(), $shutdown_res_mut);
3123
+ locked_close_channel!($self, $peer_state, &channel.context(), $shutdown_res_mut);
3124
3124
channel
3125
3125
}
3126
3126
}
@@ -4069,7 +4069,7 @@ where
4069
4069
let mut peer_state = peer_state_mutex.lock().unwrap();
4070
4070
if let Some(mut chan) = peer_state.channel_by_id.remove(&channel_id) {
4071
4071
let mut close_res = chan.force_shutdown(false, ClosureReason::FundingBatchClosure);
4072
- locked_close_channel!(self, &mut *peer_state, chan.context(), chan.funding(), close_res);
4072
+ locked_close_channel!(self, &mut *peer_state, chan.context(), close_res);
4073
4073
shutdown_results.push(close_res);
4074
4074
}
4075
4075
}
@@ -5353,7 +5353,7 @@ where
5353
5353
.map(|(mut chan, mut peer_state)| {
5354
5354
let closure_reason = ClosureReason::ProcessingError { err: e.clone() };
5355
5355
let mut close_res = chan.force_shutdown(false, closure_reason);
5356
- locked_close_channel!(self, peer_state, chan.context(), chan.funding(), close_res);
5356
+ locked_close_channel!(self, peer_state, chan.context(), close_res);
5357
5357
shutdown_results.push(close_res);
5358
5358
peer_state.pending_msg_events.push(events::MessageSendEvent::HandleError {
5359
5359
node_id: counterparty_node_id,
@@ -6601,8 +6601,8 @@ where
6601
6601
"Force-closing pending channel with ID {} for not establishing in a timely manner",
6602
6602
context.channel_id());
6603
6603
let mut close_res = chan.force_shutdown(false, ClosureReason::HolderForceClosed { broadcasted_latest_txn: Some(false) });
6604
- let (funding, context) = chan.funding_and_context_mut ();
6605
- locked_close_channel!(self, peer_state, context, funding, close_res);
6604
+ let context = chan.context_mut ();
6605
+ locked_close_channel!(self, peer_state, context, close_res);
6606
6606
shutdown_channels.push(close_res);
6607
6607
pending_msg_events.push(MessageSendEvent::HandleError {
6608
6608
node_id: context.get_counterparty_node_id(),
@@ -9602,10 +9602,9 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
9602
9602
};
9603
9603
if let Some(mut shutdown_result) = shutdown_result {
9604
9604
let context = &chan.context();
9605
- let funding = chan.funding();
9606
9605
let logger = WithChannelContext::from(&self.logger, context, None);
9607
9606
log_trace!(logger, "Removing channel {} now that the signer is unblocked", context.channel_id());
9608
- locked_close_channel!(self, peer_state, context, funding, shutdown_result);
9607
+ locked_close_channel!(self, peer_state, context, shutdown_result);
9609
9608
shutdown_results.push(shutdown_result);
9610
9609
false
9611
9610
} else {
@@ -9647,7 +9646,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
9647
9646
}
9648
9647
debug_assert_eq!(shutdown_result_opt.is_some(), funded_chan.is_shutdown());
9649
9648
if let Some(mut shutdown_result) = shutdown_result_opt {
9650
- locked_close_channel!(self, peer_state, &funded_chan.context, &funded_chan.funding, shutdown_result);
9649
+ locked_close_channel!(self, peer_state, &funded_chan.context, shutdown_result);
9651
9650
shutdown_results.push(shutdown_result);
9652
9651
}
9653
9652
if let Some(tx) = tx_opt {
@@ -11347,7 +11346,7 @@ where
11347
11346
// reorged out of the main chain. Close the channel.
11348
11347
let reason_message = format!("{}", reason);
11349
11348
let mut close_res = funded_channel.context.force_shutdown(&funded_channel.funding, true, reason);
11350
- locked_close_channel!(self, peer_state, &funded_channel.context, &funded_channel.funding, close_res);
11349
+ locked_close_channel!(self, peer_state, &funded_channel.context, close_res);
11351
11350
failed_channels.push(close_res);
11352
11351
if let Ok(update) = self.get_channel_update_for_broadcast(&funded_channel) {
11353
11352
let mut pending_broadcast_messages = self.pending_broadcast_messages.lock().unwrap();
@@ -11784,8 +11783,8 @@ where
11784
11783
}
11785
11784
// Clean up for removal.
11786
11785
let mut close_res = chan.force_shutdown(false, ClosureReason::DisconnectedPeer);
11787
- let (funding, context) = chan.funding_and_context_mut ();
11788
- locked_close_channel!(self, peer_state, &context, funding, close_res);
11786
+ let context = chan.context_mut ();
11787
+ locked_close_channel!(self, peer_state, &context, close_res);
11789
11788
failed_channels.push(close_res);
11790
11789
false
11791
11790
});
0 commit comments