Skip to content

Commit e47160d

Browse files
committed
routing: fix MC probability order for blinded paths
Fix the blinded path probability sorting function. Also fix the test assertion function.
1 parent d776174 commit e47160d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

routing/router.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ func (r *ChannelRouter) FindBlindedPaths(destination route.Vertex,
746746

747747
// Sort the routes based on probability.
748748
sort.Slice(routes, func(i, j int) bool {
749-
return routes[i].probability < routes[j].probability
749+
return routes[i].probability > routes[j].probability
750750
})
751751

752752
// Now just choose the best paths up until the maximum number of allowed

routing/router_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3150,7 +3150,7 @@ func TestFindBlindedPathsWithMC(t *testing.T) {
31503150
}
31513151

31523152
for i, path := range expectedPaths {
3153-
require.Equal(t, expectedPaths[i], path)
3153+
require.Equal(t, path, actualPaths[i])
31543154
}
31553155
}
31563156

0 commit comments

Comments
 (0)