@@ -3002,7 +3002,7 @@ macro_rules! handle_error {
30023002/// Note that this step can be skipped if the channel was never opened (through the creation of a
30033003/// [`ChannelMonitor`]/channel funding transaction) to begin with.
30043004macro_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) => {{
30063006 if let Some((_, funding_txo, _, update)) = $shutdown_res_mut.monitor_update.take() {
30073007 handle_new_monitor_update!($self, funding_txo, update, $peer_state,
30083008 $channel_context, REMAIN_LOCKED_UPDATE_ACTIONS_PROCESSED_LATER);
@@ -3050,7 +3050,7 @@ macro_rules! convert_channel_err {
30503050 let logger = WithChannelContext::from(&$self.logger, &$context, None);
30513051 log_error!(logger, "Closing channel {} due to close-required error: {}", $channel_id, msg);
30523052 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);
30543054 let err =
30553055 MsgHandleErrInternal::from_finish_shutdown(msg, *$channel_id, shutdown_res, $channel_update);
30563056 (true, err)
@@ -3115,7 +3115,7 @@ macro_rules! remove_channel_entry {
31153115 ($self: ident, $peer_state: expr, $entry: expr, $shutdown_res_mut: expr) => {
31163116 {
31173117 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);
31193119 channel
31203120 }
31213121 }
@@ -4064,7 +4064,7 @@ where
40644064 let mut peer_state = peer_state_mutex.lock().unwrap();
40654065 if let Some(mut chan) = peer_state.channel_by_id.remove(&channel_id) {
40664066 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);
40684068 shutdown_results.push(close_res);
40694069 }
40704070 }
@@ -5348,7 +5348,7 @@ where
53485348 .map(|(mut chan, mut peer_state)| {
53495349 let closure_reason = ClosureReason::ProcessingError { err: e.clone() };
53505350 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);
53525352 shutdown_results.push(close_res);
53535353 peer_state.pending_msg_events.push(events::MessageSendEvent::HandleError {
53545354 node_id: counterparty_node_id,
@@ -6596,8 +6596,8 @@ where
65966596 "Force-closing pending channel with ID {} for not establishing in a timely manner",
65976597 context.channel_id());
65986598 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);
66016601 shutdown_channels.push(close_res);
66026602 pending_msg_events.push(MessageSendEvent::HandleError {
66036603 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/
95979597 };
95989598 if let Some(mut shutdown_result) = shutdown_result {
95999599 let context = &chan.context();
9600- let funding = chan.funding();
96019600 let logger = WithChannelContext::from(&self.logger, context, None);
96029601 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);
96049603 shutdown_results.push(shutdown_result);
96059604 false
96069605 } else {
@@ -9642,7 +9641,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
96429641 }
96439642 debug_assert_eq!(shutdown_result_opt.is_some(), funded_chan.is_shutdown());
96449643 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);
96469645 shutdown_results.push(shutdown_result);
96479646 }
96489647 if let Some(tx) = tx_opt {
@@ -11342,7 +11341,7 @@ where
1134211341 // reorged out of the main chain. Close the channel.
1134311342 let reason_message = format!("{}", reason);
1134411343 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);
1134611345 failed_channels.push(close_res);
1134711346 if let Ok(update) = self.get_channel_update_for_broadcast(&funded_channel) {
1134811347 let mut pending_broadcast_messages = self.pending_broadcast_messages.lock().unwrap();
@@ -11779,8 +11778,8 @@ where
1177911778 }
1178011779 // Clean up for removal.
1178111780 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);
1178411783 failed_channels.push(close_res);
1178511784 false
1178611785 });
0 commit comments