@@ -3000,7 +3000,7 @@ macro_rules! handle_error {
3000
3000
/// Note that this step can be skipped if the channel was never opened (through the creation of a
3001
3001
/// [`ChannelMonitor`]/channel funding transaction) to begin with.
3002
3002
macro_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) => {{
3004
3004
if let Some((_, funding_txo, _, update)) = $shutdown_res_mut.monitor_update.take() {
3005
3005
handle_new_monitor_update!($self, funding_txo, update, $peer_state,
3006
3006
$channel_context, REMAIN_LOCKED_UPDATE_ACTIONS_PROCESSED_LATER);
@@ -3048,7 +3048,7 @@ macro_rules! convert_channel_err {
3048
3048
let logger = WithChannelContext::from(&$self.logger, &$context, None);
3049
3049
log_error!(logger, "Closing channel {} due to close-required error: {}", $channel_id, msg);
3050
3050
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);
3052
3052
let err =
3053
3053
MsgHandleErrInternal::from_finish_shutdown(msg, *$channel_id, shutdown_res, $channel_update);
3054
3054
(true, err)
@@ -3113,7 +3113,7 @@ macro_rules! remove_channel_entry {
3113
3113
($self: ident, $peer_state: expr, $entry: expr, $shutdown_res_mut: expr) => {
3114
3114
{
3115
3115
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);
3117
3117
channel
3118
3118
}
3119
3119
}
@@ -4062,7 +4062,7 @@ where
4062
4062
let mut peer_state = peer_state_mutex.lock().unwrap();
4063
4063
if let Some(mut chan) = peer_state.channel_by_id.remove(&channel_id) {
4064
4064
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);
4066
4066
shutdown_results.push(close_res);
4067
4067
}
4068
4068
}
@@ -5361,7 +5361,7 @@ where
5361
5361
.map(|(mut chan, mut peer_state)| {
5362
5362
let closure_reason = ClosureReason::ProcessingError { err: e.clone() };
5363
5363
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);
5365
5365
shutdown_results.push(close_res);
5366
5366
peer_state.pending_msg_events.push(MessageSendEvent::HandleError {
5367
5367
node_id: counterparty_node_id,
@@ -6609,8 +6609,8 @@ where
6609
6609
"Force-closing pending channel with ID {} for not establishing in a timely manner",
6610
6610
context.channel_id());
6611
6611
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);
6614
6614
shutdown_channels.push(close_res);
6615
6615
pending_msg_events.push(MessageSendEvent::HandleError {
6616
6616
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/
9610
9610
};
9611
9611
if let Some(mut shutdown_result) = shutdown_result {
9612
9612
let context = &chan.context();
9613
- let funding = chan.funding();
9614
9613
let logger = WithChannelContext::from(&self.logger, context, None);
9615
9614
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);
9617
9616
shutdown_results.push(shutdown_result);
9618
9617
false
9619
9618
} else {
@@ -9655,7 +9654,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
9655
9654
}
9656
9655
debug_assert_eq!(shutdown_result_opt.is_some(), funded_chan.is_shutdown());
9657
9656
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);
9659
9658
shutdown_results.push(shutdown_result);
9660
9659
}
9661
9660
if let Some(tx) = tx_opt {
@@ -10997,8 +10996,8 @@ where
10997
10996
}
10998
10997
// Clean up for removal.
10999
10998
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);
11002
11001
failed_channels.push(close_res);
11003
11002
false
11004
11003
});
@@ -11568,7 +11567,7 @@ where
11568
11567
// reorged out of the main chain. Close the channel.
11569
11568
let reason_message = format!("{}", reason);
11570
11569
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);
11572
11571
failed_channels.push(close_res);
11573
11572
if let Ok(update) = self.get_channel_update_for_broadcast(&funded_channel) {
11574
11573
let mut pending_broadcast_messages = self.pending_broadcast_messages.lock().unwrap();
0 commit comments