Improved fix for MMR dup detection

This commit is contained in:
Ignotus Peverell
2017-12-06 00:47:26 +00:00
committed by Simon B
parent cac6181c21
commit be094883de
2 changed files with 24 additions and 29 deletions
+5 -1
View File
@@ -347,7 +347,11 @@ where
/// Helper function to get the HashSum of a node at a given position from
/// the backend.
pub fn get(&self, position: u64) -> Option<HashSum<T>> {
self.backend.get(position)
if position > self.last_pos {
None
} else {
self.backend.get(position)
}
}
/// Helper function to get the last N nodes inserted, i.e. the last