Skip to content

Commit c6d6d4c

Browse files
authored
Merge pull request #9913 from yyforyongyu/debug-switch
htlcswitch+lntest: add more debug logs
2 parents a0f658b + 26960e3 commit c6d6d4c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

htlcswitch/switch.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,6 +2270,9 @@ func (s *Switch) getLinkByMapping(pkt *htlcPacket) (ChannelLink, error) {
22702270
// forwardingIndex.
22712271
link, ok := s.forwardingIndex[baseScid]
22722272
if !ok {
2273+
log.Debugf("Forwarding index not found using "+
2274+
"baseScid=%v", baseScid)
2275+
22732276
// Link not found, bail.
22742277
return nil, ErrChannelLinkNotFound
22752278
}
@@ -2291,6 +2294,9 @@ func (s *Switch) getLinkByMapping(pkt *htlcPacket) (ChannelLink, error) {
22912294
// negotiated. We'll fetch the link and return it.
22922295
link, ok := s.forwardingIndex[chanID]
22932296
if !ok {
2297+
log.Debugf("Forwarding index not found using "+
2298+
"chanID=%v", chanID)
2299+
22942300
// The link wasn't found, bail out.
22952301
return nil, ErrChannelLinkNotFound
22962302
}
@@ -2301,6 +2307,9 @@ func (s *Switch) getLinkByMapping(pkt *htlcPacket) (ChannelLink, error) {
23012307
// Fetch the link whose internal SCID is baseScid.
23022308
link, ok := s.forwardingIndex[baseScid]
23032309
if !ok {
2310+
log.Debugf("Forwarding index not found using baseScid=%v",
2311+
baseScid)
2312+
23042313
// Link wasn't found, bail out.
23052314
return nil, ErrChannelLinkNotFound
23062315
}

lntest/harness.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,8 @@ func (h *HarnessTest) completePaymentRequestsAssertStatus(hn *node.HarnessNode,
15881588
h.AssertPaymentStatusFromStream(stream, status)
15891589

15901590
case <-timer:
1591-
require.Fail(h, "timeout", "waiting payment results timeout")
1591+
require.Failf(h, "timeout", "%s: waiting payment results "+
1592+
"timeout", hn.Name())
15921593
}
15931594
}
15941595

0 commit comments

Comments
 (0)