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 committed 2024-08-07 17:01:21 +02:00
1 parent d77617461d
commit e47160d257
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -746,7 +746,7 @@ func (r *ChannelRouter) FindBlindedPaths(destination route.Vertex,
// Sort the routes based on probability.
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
+1 -1
View File
@@ -3150,7 +3150,7 @@ func TestFindBlindedPathsWithMC(t *testing.T) {
}
for i, path := range expectedPaths {
require.Equal(t, expectedPaths[i], path)
require.Equal(t, path, actualPaths[i])
}
}