@@ -3007,7 +3007,7 @@ macro_rules! handle_error {
30073007/// Note that this step can be skipped if the channel was never opened (through the creation of a
30083008/// [`ChannelMonitor`]/channel funding transaction) to begin with.
30093009macro_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) => {{
30113011 if let Some((_, funding_txo, _, update)) = $shutdown_res_mut.monitor_update.take() {
30123012 handle_new_monitor_update!($self, funding_txo, update, $peer_state,
30133013 $channel_context, REMAIN_LOCKED_UPDATE_ACTIONS_PROCESSED_LATER);
@@ -3055,7 +3055,7 @@ macro_rules! convert_channel_err {
30553055 let logger = WithChannelContext::from(&$self.logger, &$context, None);
30563056 log_error!(logger, "Closing channel {} due to close-required error: {}", $channel_id, msg);
30573057 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);
30593059 let err =
30603060 MsgHandleErrInternal::from_finish_shutdown(msg, *$channel_id, shutdown_res, $channel_update);
30613061 (true, err)
@@ -3120,7 +3120,7 @@ macro_rules! remove_channel_entry {
31203120 ($self: ident, $peer_state: expr, $entry: expr, $shutdown_res_mut: expr) => {
31213121 {
31223122 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);
31243124 channel
31253125 }
31263126 }
@@ -4069,7 +4069,7 @@ where
40694069 let mut peer_state = peer_state_mutex.lock().unwrap();
40704070 if let Some(mut chan) = peer_state.channel_by_id.remove(&channel_id) {
40714071 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);
40734073 shutdown_results.push(close_res);
40744074 }
40754075 }
@@ -5353,7 +5353,7 @@ where
53535353 .map(|(mut chan, mut peer_state)| {
53545354 let closure_reason = ClosureReason::ProcessingError { err: e.clone() };
53555355 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);
53575357 shutdown_results.push(close_res);
53585358 peer_state.pending_msg_events.push(events::MessageSendEvent::HandleError {
53595359 node_id: counterparty_node_id,
@@ -6601,8 +6601,8 @@ where
66016601 "Force-closing pending channel with ID {} for not establishing in a timely manner",
66026602 context.channel_id());
66036603 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);
66066606 shutdown_channels.push(close_res);
66076607 pending_msg_events.push(MessageSendEvent::HandleError {
66086608 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/
96029602 };
96039603 if let Some(mut shutdown_result) = shutdown_result {
96049604 let context = &chan.context();
9605- let funding = chan.funding();
96069605 let logger = WithChannelContext::from(&self.logger, context, None);
96079606 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);
96099608 shutdown_results.push(shutdown_result);
96109609 false
96119610 } else {
@@ -9647,7 +9646,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
96479646 }
96489647 debug_assert_eq!(shutdown_result_opt.is_some(), funded_chan.is_shutdown());
96499648 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);
96519650 shutdown_results.push(shutdown_result);
96529651 }
96539652 if let Some(tx) = tx_opt {
@@ -11347,7 +11346,7 @@ where
1134711346 // reorged out of the main chain. Close the channel.
1134811347 let reason_message = format!("{}", reason);
1134911348 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);
1135111350 failed_channels.push(close_res);
1135211351 if let Ok(update) = self.get_channel_update_for_broadcast(&funded_channel) {
1135311352 let mut pending_broadcast_messages = self.pending_broadcast_messages.lock().unwrap();
@@ -11784,8 +11783,8 @@ where
1178411783 }
1178511784 // Clean up for removal.
1178611785 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);
1178911788 failed_channels.push(close_res);
1179011789 false
1179111790 });
0 commit comments