Fix storage stage operating on empty slots (#4474)

* Fix storage stage operating on empty slots

* Reduce fn argument count

* Fix tests
This commit is contained in:
Sagar Dhawan
2019-05-29 15:01:20 -07:00
committed by GitHub
parent 4404634b14
commit 6ed071c4dd
2 changed files with 49 additions and 30 deletions

View File

@@ -177,6 +177,15 @@ impl Blocktree {
self.meta_cf.get(slot)
}
pub fn is_full(&self, slot: u64) -> bool {
if let Ok(meta) = self.meta_cf.get(slot) {
if let Some(meta) = meta {
return meta.is_full();
}
}
false
}
pub fn erasure_meta(&self, slot: u64, set_index: u64) -> Result<Option<ErasureMeta>> {
self.erasure_meta_cf.get((slot, set_index))
}