Added client function to delete a recent block (#8533)

* Implemented recent block removal

* Apply suggestions from code review

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Arkadiy Paronyan
2021-05-05 19:16:34 +03:00
committed by GitHub
parent 7c3a3f79ba
commit d11e60510e
7 changed files with 295 additions and 49 deletions
+2 -2
View File
@@ -216,8 +216,8 @@ impl<H, N> LeafSet<H, N> where
self.pending_removed.clear();
}
#[cfg(test)]
fn contains(&self, number: N, hash: H) -> bool {
/// Check if given block is a leaf.
pub fn contains(&self, number: N, hash: H) -> bool {
self.storage.get(&Reverse(number)).map_or(false, |hashes| hashes.contains(&hash))
}