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

@@ -268,7 +268,7 @@ func TestFindRoutesWithFeeLimit(t *testing.T) {
CltvLimit: math.MaxUint32,
}
route, err := ctx.router.FindRoute(
route, _, err := ctx.router.FindRoute(
ctx.router.selfNode.PubKeyBytes,
target, paymentAmt, 0, restrictions, nil, nil,
MinCLTVDelta,
@@ -1554,7 +1554,7 @@ func TestAddEdgeUnknownVertexes(t *testing.T) {
targetNode := priv2.PubKey()
var targetPubKeyBytes route.Vertex
copy(targetPubKeyBytes[:], targetNode.SerializeCompressed())
_, err = ctx.router.FindRoute(
_, _, err = ctx.router.FindRoute(
ctx.router.selfNode.PubKeyBytes,
targetPubKeyBytes, paymentAmt, 0, noRestrictions, nil, nil,
MinCLTVDelta,
@@ -1595,7 +1595,7 @@ func TestAddEdgeUnknownVertexes(t *testing.T) {
// Should still be able to find the route, and the info should be
// updated.
_, err = ctx.router.FindRoute(
_, _, err = ctx.router.FindRoute(
ctx.router.selfNode.PubKeyBytes,
targetPubKeyBytes, paymentAmt, 0, noRestrictions, nil, nil,
MinCLTVDelta,