mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-05-06 01:40:26 +02:00
switch: add trace log for circular route detection
Helps with debugging of strict forwarding issues.
This commit is contained in:
parent
24fdae7dff
commit
cf0e0ff32c
@ -1149,6 +1149,9 @@ func (s *Switch) handlePacketForward(packet *htlcPacket) error {
|
||||
func (s *Switch) checkCircularForward(incoming, outgoing lnwire.ShortChannelID,
|
||||
allowCircular bool, paymentHash lntypes.Hash) *LinkError {
|
||||
|
||||
log.Tracef("Checking for circular route: incoming=%v, outgoing=%v "+
|
||||
"(payment hash: %x)", incoming, outgoing, paymentHash[:])
|
||||
|
||||
// If they are equal, we can skip the alias mapping checks.
|
||||
if incoming == outgoing {
|
||||
// The switch may be configured to allow circular routes, so
|
||||
@ -1189,6 +1192,10 @@ func (s *Switch) checkCircularForward(incoming, outgoing lnwire.ShortChannelID,
|
||||
|
||||
// Check base SCID equality.
|
||||
if incomingBaseScid != outgoingBaseScid {
|
||||
log.Tracef("Incoming base SCID %v does not match outgoing "+
|
||||
"base SCID %v (payment hash: %x)", incomingBaseScid,
|
||||
outgoingBaseScid, paymentHash[:])
|
||||
|
||||
// The base SCIDs are not equal so these are not the same
|
||||
// channel.
|
||||
return nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user