routing: add source parameter to query routes
This commit allows execution of QueryRoutes from any source node. Previously this was restricted to only the self node.
This commit is contained in:
7 files changed
+646
-586
No files matched your search
+5
-5
@@ -1325,9 +1325,9 @@ func pathsToFeeSortedRoutes(source Vertex, paths [][]*channeldb.ChannelEdgePolic
|
||||
// the required fee and time lock values running backwards along the route. The
|
||||
// route that will be ranked the highest is the one with the lowest cumulative
|
||||
// fee along the route.
|
||||
func (r *ChannelRouter) FindRoutes(target Vertex, amt lnwire.MilliSatoshi,
|
||||
restrictions *RestrictParams, numPaths uint32, finalExpiry ...uint16) (
|
||||
[]*Route, error) {
|
||||
func (r *ChannelRouter) FindRoutes(source, target Vertex,
|
||||
amt lnwire.MilliSatoshi, restrictions *RestrictParams, numPaths uint32,
|
||||
finalExpiry ...uint16) ([]*Route, error) {
|
||||
|
||||
var finalCLTVDelta uint16
|
||||
if len(finalExpiry) == 0 {
|
||||
@@ -1394,8 +1394,8 @@ func (r *ChannelRouter) FindRoutes(target Vertex, amt lnwire.MilliSatoshi,
|
||||
// we'll execute our KSP algorithm to find the k-shortest paths from
|
||||
// our source to the destination.
|
||||
shortestPaths, err := findPaths(
|
||||
tx, r.cfg.Graph, r.selfNode.PubKeyBytes, target, amt,
|
||||
restrictions, numPaths, bandwidthHints,
|
||||
tx, r.cfg.Graph, source, target, amt, restrictions,
|
||||
numPaths, bandwidthHints,
|
||||
)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
|
||||
Reference in new issue
Block a user