routing: modify findRoute to accept starting node as a paramter

This commit slightly modified findRoute to accept the node which should
be used as the starting point in our path finding algorithm. With this
change, as we move to a k-shortest paths algorithm this modification
will be needed as all of our path finding attempts won’t always
originate from a the same starting point.
This commit is contained in:
Olaoluwa Osuntokun
2017-03-19 14:32:52 -07:00
parent b6199f27da
commit c6c56173a8
3 changed files with 37 additions and 20 deletions

View File

@ -1068,7 +1068,7 @@ func (r *ChannelRouter) FindRoute(target *btcec.PublicKey, amt btcutil.Amount) (
}
// TODO(roasbeef): add k-shortest paths
route, err := findRoute(r.cfg.Graph, target, amt)
route, err := findRoute(r.cfg.Graph, r.selfNode, target, amt)
if err != nil {
log.Errorf("Unable to find path: %v", err)
return nil, err