prunes received-cache only once per unique owner's key (#17039)

This commit is contained in:
behzad nouri
2021-05-13 13:50:16 +00:00
committed by GitHub
parent 0aa7824884
commit 0e646d10bb
4 changed files with 63 additions and 68 deletions

View File

@ -357,15 +357,11 @@ fn network_run_push(
})
.unwrap();
let updated_labels: Vec<_> =
updated.into_iter().map(|u| u.value.label()).collect();
let origins: HashSet<_> =
updated.into_iter().map(|u| u.value.pubkey()).collect();
let prunes_map = network
.get(&to)
.map(|node| {
node.lock()
.unwrap()
.prune_received_cache(updated_labels, &stakes)
})
.map(|node| node.lock().unwrap().prune_received_cache(origins, &stakes))
.unwrap();
for (from, prune_set) in prunes_map {