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
2019-03-05 16:49:26 +01:00
parent 7719bc432f
commit c62c9d64da
7 changed files with 646 additions and 586 deletions

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)