Skip to content

Commit cf0e0ff

Browse files
committed
switch: add trace log for circular route detection
Helps with debugging of strict forwarding issues.
1 parent 24fdae7 commit cf0e0ff

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

htlcswitch/switch.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,6 +1149,9 @@ func (s *Switch) handlePacketForward(packet *htlcPacket) error {
11491149
func (s *Switch) checkCircularForward(incoming, outgoing lnwire.ShortChannelID,
11501150
allowCircular bool, paymentHash lntypes.Hash) *LinkError {
11511151

1152+
log.Tracef("Checking for circular route: incoming=%v, outgoing=%v "+
1153+
"(payment hash: %x)", incoming, outgoing, paymentHash[:])
1154+
11521155
// If they are equal, we can skip the alias mapping checks.
11531156
if incoming == outgoing {
11541157
// The switch may be configured to allow circular routes, so
@@ -1189,6 +1192,10 @@ func (s *Switch) checkCircularForward(incoming, outgoing lnwire.ShortChannelID,
11891192

11901193
// Check base SCID equality.
11911194
if incomingBaseScid != outgoingBaseScid {
1195+
log.Tracef("Incoming base SCID %v does not match outgoing "+
1196+
"base SCID %v (payment hash: %x)", incomingBaseScid,
1197+
outgoingBaseScid, paymentHash[:])
1198+
11921199
// The base SCIDs are not equal so these are not the same
11931200
// channel.
11941201
return nil

0 commit comments

Comments
 (0)