Sort the results of queryRandom in best-to-worst order
This commit is contained in:
parent
02372849f1
commit
3d37e08085
|
@ -946,7 +946,7 @@ proc queryRandom*(
|
|||
filtered.add((score, n))
|
||||
|
||||
d.rng[].shuffle(filtered)
|
||||
return filtered.sortedByIt(it[0]).mapIt(it[1])
|
||||
return filtered.sortedByIt(-it[0]).mapIt(it[1])
|
||||
|
||||
proc trimConnections(node: Eth2Node, count: int) {.async.} =
|
||||
# Kill `count` peers, scoring them to remove the least useful ones
|
||||
|
|
Loading…
Reference in New Issue