From e9b7e8084899b7a157878390d54bad1c5c870928 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Wed, 15 Jan 2020 20:28:48 +0100 Subject: [PATCH] routing: remove path finding shortcut This shortcut does not work when the destination is a private node. We also don't have this shortcut for regular payments. This commit aligns the behavior between SendPayment and QueryRoutes. --- routing/errors.go | 7 +------ routing/router.go | 9 --------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/routing/errors.go b/routing/errors.go index 44ad7a63..3166f739 100644 --- a/routing/errors.go +++ b/routing/errors.go @@ -7,14 +7,9 @@ import "github.com/go-errors/errors" type errorCode uint8 const ( - // ErrTargetNotInNetwork is returned when the target of a path-finding - // or payment attempt isn't known to be within the current version of - // the channel graph. - ErrTargetNotInNetwork errorCode = iota - // ErrOutdated is returned when the routing update already have // been applied, or a newer update is already known. - ErrOutdated + ErrOutdated errorCode = iota // ErrIgnored is returned when the update have been ignored because // this update can't bring us something new, or because a node diff --git a/routing/router.go b/routing/router.go index 8efa63e0..a7c24ba4 100644 --- a/routing/router.go +++ b/routing/router.go @@ -1407,15 +1407,6 @@ func (r *ChannelRouter) FindRoute(source, target route.Vertex, log.Debugf("Searching for path to %v, sending %v", target, amt) - // We can short circuit the routing by opportunistically checking to - // see if the target vertex event exists in the current graph. - if _, exists, err := r.cfg.Graph.HasLightningNode(target); err != nil { - return nil, err - } else if !exists { - log.Debugf("Target %x is not in known graph", target) - return nil, newErrf(ErrTargetNotInNetwork, "target not found") - } - // We'll attempt to obtain a set of bandwidth hints that can help us // eliminate certain routes early on in the path finding process. bandwidthHints, err := generateBandwidthHints(