Add cluster state verifier logging (#16330)

* Add cluster state verifier logging

* Add duplicate-slots iterator to ledger tool
This commit is contained in:
carllin
2021-04-02 21:48:44 -07:00
committed by GitHub
parent e4889220c4
commit 4e5ef6bce2
5 changed files with 55 additions and 1 deletions

View File

@ -2855,6 +2855,13 @@ impl Blockstore {
Ok(dead_slots_iterator.map(|(slot, _)| slot))
}
pub fn duplicate_slots_iterator(&self, slot: Slot) -> Result<impl Iterator<Item = Slot> + '_> {
let duplicate_slots_iterator = self
.db
.iter::<cf::DuplicateSlots>(IteratorMode::From(slot, IteratorDirection::Forward))?;
Ok(duplicate_slots_iterator.map(|(slot, _)| slot))
}
pub fn last_root(&self) -> Slot {
*self.last_root.read().unwrap()
}