Add --allow-dead-slots argument to slot/print/json commands (#9408)

automerge
This commit is contained in:
Michael Vines
2020-04-09 20:10:51 -07:00
committed by GitHub
parent 900933bbcc
commit d5a9ee97f2
5 changed files with 50 additions and 12 deletions

View File

@ -1797,7 +1797,7 @@ impl Blockstore {
/// Returns the entry vector for the slot starting with `shred_start_index`
pub fn get_slot_entries(&self, slot: Slot, shred_start_index: u64) -> Result<Vec<Entry>> {
self.get_slot_entries_with_shred_info(slot, shred_start_index)
self.get_slot_entries_with_shred_info(slot, shred_start_index, false)
.map(|x| x.0)
}
@ -1807,8 +1807,9 @@ impl Blockstore {
&self,
slot: Slot,
start_index: u64,
allow_dead_slots: bool,
) -> Result<(Vec<Entry>, u64, bool)> {
if self.is_dead(slot) {
if self.is_dead(slot) && !allow_dead_slots {
return Err(BlockstoreError::DeadSlot);
}

View File

@ -538,7 +538,7 @@ pub fn confirm_slot(
let (entries, num_shreds, slot_full) = {
let mut load_elapsed = Measure::start("load_elapsed");
let load_result = blockstore
.get_slot_entries_with_shred_info(slot, progress.num_shreds)
.get_slot_entries_with_shred_info(slot, progress.num_shreds, false)
.map_err(BlockstoreProcessorError::FailedToLoadEntries);
load_elapsed.stop();
if load_result.is_err() {