Retry latest vote if expired (#16735)

This commit is contained in:
carllin
2021-04-28 11:46:16 -07:00
committed by GitHub
parent 9070191b8b
commit b5d30846d6
6 changed files with 732 additions and 170 deletions

View File

@@ -259,6 +259,7 @@ pub(crate) struct ForkStats {
pub(crate) computed: bool,
pub(crate) lockout_intervals: LockoutIntervals,
pub(crate) bank_hash: Option<Hash>,
pub(crate) my_latest_landed_vote: Option<Slot>,
}
#[derive(Clone, Default)]
@@ -532,6 +533,12 @@ impl ProgressMap {
}
}
pub fn my_latest_landed_vote(&self, slot: Slot) -> Option<Slot> {
self.progress_map
.get(&slot)
.and_then(|s| s.fork_stats.my_latest_landed_vote)
}
pub fn set_supermajority_confirmed_slot(&mut self, slot: Slot) {
let slot_progress = self.get_mut(&slot).unwrap();
slot_progress.fork_stats.is_supermajority_confirmed = true;