Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Handle errors on replaying ledger properly (bp #7741) (#7755)
Browse files Browse the repository at this point in the history
automerge
  • Loading branch information
mergify[bot] authored and solana-grimes committed Jan 10, 2020
1 parent 32a728d commit 5b006eb
Show file tree
Hide file tree
Showing 3 changed files with 205 additions and 72 deletions.
3 changes: 3 additions & 0 deletions ledger/src/blocktree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1427,6 +1427,9 @@ impl Blocktree {
slot: Slot,
start_index: u64,
) -> Result<(Vec<Entry>, usize, bool)> {
if self.is_dead(slot) {
return Err(BlocktreeError::DeadSlot);
}
let slot_meta_cf = self.db.column::<cf::SlotMeta>();
let slot_meta = slot_meta_cf.get(slot)?;
if slot_meta.is_none() {
Expand Down
1 change: 1 addition & 0 deletions ledger/src/blocktree_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub enum BlocktreeError {
InvalidShredData(Box<bincode::ErrorKind>),
RocksDb(#[from] rocksdb::Error),
SlotNotRooted,
DeadSlot,
IO(#[from] std::io::Error),
Serialize(#[from] Box<bincode::ErrorKind>),
FsExtraError(#[from] fs_extra::error::Error),
Expand Down
Loading

0 comments on commit 5b006eb

Please sign in to comment.