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:
Joost Jager committed 2019-03-06 15:31:03 +01:00
1 parent 7719bc432f
commit c62c9d64da
7 files changed
+646 -586

No files matched your search

+2 -2
View File
@@ -1712,7 +1712,7 @@ func TestPathFindSpecExample(t *testing.T) {
carol := ctx.aliases["C"]
const amt lnwire.MilliSatoshi = 4999999
routes, err := ctx.router.FindRoutes(
carol, amt, noRestrictions, 100,
bobNode.PubKeyBytes, carol, amt, noRestrictions, 100,
)
if err != nil {
t.Fatalf("unable to find route: %v", err)
@@ -1779,7 +1779,7 @@ func TestPathFindSpecExample(t *testing.T) {
// We'll now request a route from A -> B -> C.
ctx.router.routeCache = make(map[routeTuple][]*Route)
routes, err = ctx.router.FindRoutes(
carol, amt, noRestrictions, 100,
source.PubKeyBytes, carol, amt, noRestrictions, 100,
)
if err != nil {
t.Fatalf("unable to find routes: %v", err)