Skip to content

Commit

Permalink
Merge pull request #3918 from joostjager/fix-qr-hints
Browse files Browse the repository at this point in the history
routing: remove path finding shortcut
  • Loading branch information
joostjager authored Jan 15, 2020
2 parents 27139b8 + e9b7e80 commit 3aba0f1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
7 changes: 1 addition & 6 deletions routing/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 0 additions & 9 deletions routing/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 3aba0f1

Please sign in to comment.