Skip to content

Commit

Permalink
Log channel balances before deleting channel data
Browse files Browse the repository at this point in the history
It would be even nicer to log the `ChannelDetails`, but then we would
have to modify the macro and that is too painful.
  • Loading branch information
luckysori committed Nov 20, 2023
1 parent 3274833 commit c3b31df
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c3b31df

Please sign in to comment.