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 Dec 18, 2023
1 parent a6a4798 commit 9fb4454
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 @@ -1992,6 +1992,12 @@ macro_rules! try_chan_phase_entry {
macro_rules! remove_channel_phase {
($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().0[..]), 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 9fb4454

Please sign in to comment.