mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-02 16:21:42 +00:00
Process head_chains in descending order of number of peers (#8859)
N/A Another find by @gitToki. Sort the preferred_ids in descending order as originally intended from the comment in the function. Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com>
This commit is contained in:
@@ -351,7 +351,8 @@ impl<T: BeaconChainTypes> ChainCollection<T> {
|
||||
.iter()
|
||||
.map(|(id, chain)| (chain.available_peers(), !chain.is_syncing(), *id))
|
||||
.collect::<Vec<_>>();
|
||||
preferred_ids.sort_unstable();
|
||||
// Sort in descending order
|
||||
preferred_ids.sort_unstable_by(|a, b| b.cmp(a));
|
||||
|
||||
let mut syncing_chains = SmallVec::<[Id; PARALLEL_HEAD_CHAINS]>::new();
|
||||
for (_, _, id) in preferred_ids {
|
||||
|
||||
Reference in New Issue
Block a user