From 09386213be61f6d24ab08778a159002fd6ec2532 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Tue, 13 Jul 2021 10:10:38 +0200 Subject: [PATCH] htlcswitch: log link message with channel point In lnd, log messages about channels are generally logged with a reference to their channel point rather than the short channel id. Channel point is reorg-resistant and also easier to look up in for example a block explorer. In the link however, all log messages are accompanied by short channel id. This makes it difficult to grep a log for all channel activity. The PEER message for example which are often crucial to analyse, are logged with channel points. This commit modifies the link logging to also use channel points. --- docs/release-notes/release-notes-0.14.0.md | 2 + htlcswitch/link.go | 2 +- lntest/itest/log_error_whitelist.txt | 50 +++++++++++----------- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/docs/release-notes/release-notes-0.14.0.md b/docs/release-notes/release-notes-0.14.0.md index 80bb14238..d9658530b 100644 --- a/docs/release-notes/release-notes-0.14.0.md +++ b/docs/release-notes/release-notes-0.14.0.md @@ -114,6 +114,8 @@ you. * [Missing dots in cmd interface](https://github.com/lightningnetwork/lnd/pull/5535). +* [Link channel point logging](https://github.com/lightningnetwork/lnd/pull/5508) + ## Database * [Ensure single writer for legacy diff --git a/htlcswitch/link.go b/htlcswitch/link.go index 9959408e5..eed8ba316 100644 --- a/htlcswitch/link.go +++ b/htlcswitch/link.go @@ -407,7 +407,7 @@ type hodlHtlc struct { func NewChannelLink(cfg ChannelLinkConfig, channel *lnwallet.LightningChannel) ChannelLink { - logPrefix := fmt.Sprintf("ChannelLink(%v):", channel.ShortChanID()) + logPrefix := fmt.Sprintf("ChannelLink(%v):", channel.ChannelPoint()) return &channelLink{ cfg: cfg, diff --git a/lntest/itest/log_error_whitelist.txt b/lntest/itest/log_error_whitelist.txt index 426f10ebd..56ae1a4c9 100644 --- a/lntest/itest/log_error_whitelist.txt +++ b/lntest/itest/log_error_whitelist.txt @@ -100,29 +100,29 @@