@@ -3000,7 +3000,7 @@ macro_rules! handle_error {
30003000/// Note that this step can be skipped if the channel was never opened (through the creation of a
30013001/// [`ChannelMonitor`]/channel funding transaction) to begin with.
30023002macro_rules! locked_close_channel {
3003- ($self: ident, $peer_state: expr, $channel_context: expr, $channel_funding: expr, $ shutdown_res_mut: expr) => {{
3003+ ($self: ident, $peer_state: expr, $channel_context: expr, $shutdown_res_mut: expr) => {{
30043004 if let Some((_, funding_txo, _, update)) = $shutdown_res_mut.monitor_update.take() {
30053005 handle_new_monitor_update!($self, funding_txo, update, $peer_state,
30063006 $channel_context, REMAIN_LOCKED_UPDATE_ACTIONS_PROCESSED_LATER);
@@ -3048,7 +3048,7 @@ macro_rules! convert_channel_err {
30483048 let logger = WithChannelContext::from(&$self.logger, &$context, None);
30493049 log_error!(logger, "Closing channel {} due to close-required error: {}", $channel_id, msg);
30503050 let mut shutdown_res = $context.force_shutdown($funding, true, reason);
3051- locked_close_channel!($self, $peer_state, $context, $funding, &mut shutdown_res);
3051+ locked_close_channel!($self, $peer_state, $context, &mut shutdown_res);
30523052 let err =
30533053 MsgHandleErrInternal::from_finish_shutdown(msg, *$channel_id, shutdown_res, $channel_update);
30543054 (true, err)
@@ -3113,7 +3113,7 @@ macro_rules! remove_channel_entry {
31133113 ($self: ident, $peer_state: expr, $entry: expr, $shutdown_res_mut: expr) => {
31143114 {
31153115 let channel = $entry.remove_entry().1;
3116- locked_close_channel!($self, $peer_state, &channel.context(), channel.funding(), $shutdown_res_mut);
3116+ locked_close_channel!($self, $peer_state, &channel.context(), $shutdown_res_mut);
31173117 channel
31183118 }
31193119 }
@@ -4062,7 +4062,7 @@ where
40624062 let mut peer_state = peer_state_mutex.lock().unwrap();
40634063 if let Some(mut chan) = peer_state.channel_by_id.remove(&channel_id) {
40644064 let mut close_res = chan.force_shutdown(false, ClosureReason::FundingBatchClosure);
4065- locked_close_channel!(self, &mut *peer_state, chan.context(), chan.funding(), close_res);
4065+ locked_close_channel!(self, &mut *peer_state, chan.context(), close_res);
40664066 shutdown_results.push(close_res);
40674067 }
40684068 }
@@ -5361,7 +5361,7 @@ where
53615361 .map(|(mut chan, mut peer_state)| {
53625362 let closure_reason = ClosureReason::ProcessingError { err: e.clone() };
53635363 let mut close_res = chan.force_shutdown(false, closure_reason);
5364- locked_close_channel!(self, peer_state, chan.context(), chan.funding(), close_res);
5364+ locked_close_channel!(self, peer_state, chan.context(), close_res);
53655365 shutdown_results.push(close_res);
53665366 peer_state.pending_msg_events.push(MessageSendEvent::HandleError {
53675367 node_id: counterparty_node_id,
@@ -6609,8 +6609,8 @@ where
66096609 "Force-closing pending channel with ID {} for not establishing in a timely manner",
66106610 context.channel_id());
66116611 let mut close_res = chan.force_shutdown(false, ClosureReason::HolderForceClosed { broadcasted_latest_txn: Some(false) });
6612- let (funding, context) = chan.funding_and_context_mut ();
6613- locked_close_channel!(self, peer_state, context, funding, close_res);
6612+ let context = chan.context_mut ();
6613+ locked_close_channel!(self, peer_state, context, close_res);
66146614 shutdown_channels.push(close_res);
66156615 pending_msg_events.push(MessageSendEvent::HandleError {
66166616 node_id: context.get_counterparty_node_id(),
@@ -9610,10 +9610,9 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
96109610 };
96119611 if let Some(mut shutdown_result) = shutdown_result {
96129612 let context = &chan.context();
9613- let funding = chan.funding();
96149613 let logger = WithChannelContext::from(&self.logger, context, None);
96159614 log_trace!(logger, "Removing channel {} now that the signer is unblocked", context.channel_id());
9616- locked_close_channel!(self, peer_state, context, funding, shutdown_result);
9615+ locked_close_channel!(self, peer_state, context, shutdown_result);
96179616 shutdown_results.push(shutdown_result);
96189617 false
96199618 } else {
@@ -9655,7 +9654,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
96559654 }
96569655 debug_assert_eq!(shutdown_result_opt.is_some(), funded_chan.is_shutdown());
96579656 if let Some(mut shutdown_result) = shutdown_result_opt {
9658- locked_close_channel!(self, peer_state, &funded_chan.context, &funded_chan.funding, shutdown_result);
9657+ locked_close_channel!(self, peer_state, &funded_chan.context, shutdown_result);
96599658 shutdown_results.push(shutdown_result);
96609659 }
96619660 if let Some(tx) = tx_opt {
@@ -10997,8 +10996,8 @@ where
1099710996 }
1099810997 // Clean up for removal.
1099910998 let mut close_res = chan.force_shutdown(false, ClosureReason::DisconnectedPeer);
11000- let (funding, context) = chan.funding_and_context_mut ();
11001- locked_close_channel!(self, peer_state, &context, funding, close_res);
10999+ let context = chan.context_mut ();
11000+ locked_close_channel!(self, peer_state, &context, close_res);
1100211001 failed_channels.push(close_res);
1100311002 false
1100411003 });
@@ -11568,7 +11567,7 @@ where
1156811567 // reorged out of the main chain. Close the channel.
1156911568 let reason_message = format!("{}", reason);
1157011569 let mut close_res = funded_channel.context.force_shutdown(&funded_channel.funding, true, reason);
11571- locked_close_channel!(self, peer_state, &funded_channel.context, &funded_channel.funding, close_res);
11570+ locked_close_channel!(self, peer_state, &funded_channel.context, close_res);
1157211571 failed_channels.push(close_res);
1157311572 if let Ok(update) = self.get_channel_update_for_broadcast(&funded_channel) {
1157411573 let mut pending_broadcast_messages = self.pending_broadcast_messages.lock().unwrap();
0 commit comments