Use LRU in connection-cache (#24109)

Switch to using LRU for connection-cache
This commit is contained in:
ryleung-solana
2022-04-06 10:58:32 -04:00
committed by GitHub
parent c322842257
commit a38bd4acc8
5 changed files with 31 additions and 56 deletions

View File

@ -571,13 +571,13 @@ pub(crate) fn submit_gossip_stats(
.pull
.votes
.into_iter()
.map(|(slot, num_votes)| (*slot, *num_votes))
.map(|(slot, num_votes)| (slot, num_votes))
.chain(
crds_stats
.push
.votes
.into_iter()
.map(|(slot, num_votes)| (*slot, *num_votes)),
.map(|(slot, num_votes)| (slot, num_votes)),
)
.into_grouping_map()
.aggregate(|acc, _slot, num_votes| Some(acc.unwrap_or_default() + num_votes));