From c3b31df7aa8eb93921da085ddbeade6414931a1c Mon Sep 17 00:00:00 2001 From: Lucas Soriano del Pino Date: Mon, 20 Nov 2023 19:18:22 +1100 Subject: [PATCH] Log channel balances before deleting channel data It would be even nicer to log the `ChannelDetails`, but then we would have to modify the macro and that is too painful. --- lightning/src/ln/channelmanager.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 88169b94df3..be7fad8989b 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -1851,6 +1851,12 @@ macro_rules! try_chan_entry { macro_rules! remove_channel { ($self: expr, $entry: expr) => { { + let context = &$entry.get().context; + let balance = context.get_available_balances(&$self.fee_estimator); + + log_debug!($self.logger, "Channel balance for {} before closure balance_msat={}, inbound_capacity_msat={}, outbound_capacity_msat={}", + log_bytes!(context.channel_id()[..]), balance.balance_msat, balance.inbound_capacity_msat, balance.outbound_capacity_msat); + let channel = $entry.remove_entry().1; update_maps_on_chan_removal!($self, &channel.context); channel