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 committed 2022-12-12 13:22:29 +01:00
1 parent 516e3a8cca
commit 66ffc64776
9 files changed
+47 -45

No files matched your search

+5 -3
View File
@@ -2291,7 +2291,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
route, err := ctx.router.FindRoute(
route, _, err := ctx.router.FindRoute(
bobNode.PubKeyBytes, carol, amt, 0, noRestrictions, nil, nil,
MinCLTVDelta,
)
@@ -2341,7 +2341,7 @@ func TestPathFindSpecExample(t *testing.T) {
}
// We'll now request a route from A -> B -> C.
route, err = ctx.router.FindRoute(
route, _, err = ctx.router.FindRoute(
source.PubKeyBytes, carol, amt, 0, noRestrictions, nil, nil,
MinCLTVDelta,
)
@@ -3117,7 +3117,7 @@ func dbFindPath(graph *channeldb.ChannelGraph,
}
}()
return findPath(
route, _, err := findPath(
&graphParams{
additionalEdges: additionalEdges,
bandwidthHints: bandwidthHints,
@@ -3125,4 +3125,6 @@ func dbFindPath(graph *channeldb.ChannelGraph,
},
r, cfg, source, target, amt, timePref, finalHtlcExpiry,
)
return route, err
}