routing: modify FindRoutes to take a max number of routes to return

This commit is contained in:
Olaoluwa Osuntokun
2018-02-12 16:19:46 -08:00
parent 33ba60ce66
commit 8a29c01354
2 changed files with 74 additions and 55 deletions

View File

@ -778,7 +778,7 @@ func TestPathFindSpecExample(t *testing.T) {
// Query for a route of 4,999,999 mSAT to carol.
carol := ctx.aliases["C"]
const amt lnwire.MilliSatoshi = 4999999
routes, err := ctx.router.FindRoutes(carol, amt)
routes, err := ctx.router.FindRoutes(carol, amt, 100)
if err != nil {
t.Fatalf("unable to find route: %v", err)
}
@ -838,7 +838,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)
routes, err = ctx.router.FindRoutes(carol, amt, 100)
if err != nil {
t.Fatalf("unable to find routes: %v", err)
}