routing: fix MC probability order for blinded paths

Fix the blinded path probability sorting function.
Also fix the test assertion function.
This commit is contained in:
Elle Mouton 2024-08-07 16:51:09 +02:00
parent d77617461d
commit e47160d257
No known key found for this signature in database
GPG key ID: D7D916376026F177
2 changed files with 2 additions and 2 deletions

View file

@ -746,7 +746,7 @@ func (r *ChannelRouter) FindBlindedPaths(destination route.Vertex,
// Sort the routes based on probability. // Sort the routes based on probability.
sort.Slice(routes, func(i, j int) bool { sort.Slice(routes, func(i, j int) bool {
return routes[i].probability < routes[j].probability return routes[i].probability > routes[j].probability
}) })
// Now just choose the best paths up until the maximum number of allowed // Now just choose the best paths up until the maximum number of allowed

View file

@ -3150,7 +3150,7 @@ func TestFindBlindedPathsWithMC(t *testing.T) {
} }
for i, path := range expectedPaths { for i, path := range expectedPaths {
require.Equal(t, expectedPaths[i], path) require.Equal(t, path, actualPaths[i])
} }
} }