router: return probability from findPath

The returned probability can then be used in QueryRoutes to not having
to reconstruct the probability.
This commit is contained in:
bitromortac
2022-11-17 13:59:21 +01:00
parent 516e3a8cca
commit 66ffc64776
9 changed files with 47 additions and 45 deletions

View File

@@ -209,11 +209,10 @@ func TestRequestRoute(t *testing.T) {
}
// Override pathfinder with a mock.
session.pathFinder = func(
g *graphParams, r *RestrictParams, cfg *PathFindingConfig,
source, target route.Vertex, amt lnwire.MilliSatoshi,
timePref float64,
finalHtlcExpiry int32) ([]*channeldb.CachedEdgePolicy, error) {
session.pathFinder = func(_ *graphParams, r *RestrictParams,
_ *PathFindingConfig, _, _ route.Vertex, _ lnwire.MilliSatoshi,
_ float64, _ int32) ([]*channeldb.CachedEdgePolicy, float64,
error) {
// We expect find path to receive a cltv limit excluding the
// final cltv delta (including the block padding).
@@ -232,7 +231,7 @@ func TestRequestRoute(t *testing.T) {
},
}
return path, nil
return path, 1.0, nil
}
route, err := session.RequestRoute(