Search for the validator with the highest snapshot

This commit is contained in:
Michael Vines
2020-02-20 12:39:53 -07:00
parent 01697a9f5c
commit cc7c6c960e
2 changed files with 88 additions and 33 deletions

View File

@ -504,6 +504,14 @@ impl ClusterInfo {
.collect()
}
pub fn get_snapshot_hash_for_node(&self, pubkey: &Pubkey) -> Option<&Vec<(Slot, Hash)>> {
self.gossip
.crds
.table
.get(&CrdsValueLabel::SnapshotHash(*pubkey))
.map(|x| &x.value.snapshot_hash().unwrap().hashes)
}
pub fn get_epoch_state_for_node(
&self,
pubkey: &Pubkey,