From 26960e36ce53ccacd0bbfc5d208dafcfe6adb110 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Fri, 6 Jun 2025 19:40:35 +0800 Subject: [PATCH] htlcswitch+lntest: add more debug logs --- htlcswitch/switch.go | 9 +++++++++ lntest/harness.go | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/htlcswitch/switch.go b/htlcswitch/switch.go index d034e732ebe..9f505845876 100644 --- a/htlcswitch/switch.go +++ b/htlcswitch/switch.go @@ -2270,6 +2270,9 @@ func (s *Switch) getLinkByMapping(pkt *htlcPacket) (ChannelLink, error) { // forwardingIndex. link, ok := s.forwardingIndex[baseScid] if !ok { + log.Debugf("Forwarding index not found using "+ + "baseScid=%v", baseScid) + // Link not found, bail. return nil, ErrChannelLinkNotFound } @@ -2291,6 +2294,9 @@ func (s *Switch) getLinkByMapping(pkt *htlcPacket) (ChannelLink, error) { // negotiated. We'll fetch the link and return it. link, ok := s.forwardingIndex[chanID] if !ok { + log.Debugf("Forwarding index not found using "+ + "chanID=%v", chanID) + // The link wasn't found, bail out. return nil, ErrChannelLinkNotFound } @@ -2301,6 +2307,9 @@ func (s *Switch) getLinkByMapping(pkt *htlcPacket) (ChannelLink, error) { // Fetch the link whose internal SCID is baseScid. link, ok := s.forwardingIndex[baseScid] if !ok { + log.Debugf("Forwarding index not found using baseScid=%v", + baseScid) + // Link wasn't found, bail out. return nil, ErrChannelLinkNotFound } diff --git a/lntest/harness.go b/lntest/harness.go index 4b12c8cf631..465c4b464b8 100644 --- a/lntest/harness.go +++ b/lntest/harness.go @@ -1588,7 +1588,8 @@ func (h *HarnessTest) completePaymentRequestsAssertStatus(hn *node.HarnessNode, h.AssertPaymentStatusFromStream(stream, status) case <-timer: - require.Fail(h, "timeout", "waiting payment results timeout") + require.Failf(h, "timeout", "%s: waiting payment results "+ + "timeout", hn.Name()) } }