mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-17 08:56:45 +00:00
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))
|
filtered.add((score, n))
|
||||||
|
|
||||||
d.rng[].shuffle(filtered)
|
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.} =
|
proc trimConnections(node: Eth2Node, count: int) {.async.} =
|
||||||
# Kill `count` peers, scoring them to remove the least useful ones
|
# Kill `count` peers, scoring them to remove the least useful ones
|
||||||
|
Loading…
x
Reference in New Issue
Block a user