Pass tree hash caching tests

This commit is contained in:
Paul Hauner
2019-03-28 14:17:25 +11:00
parent 224a967cce
commit 0d8d3385be
2 changed files with 59 additions and 2 deletions

View File

@@ -85,6 +85,14 @@ where
}
}
// Iterate backwards through the internal nodes, rehashing any node where it's children
// have changed.
for chunk in (chunk..chunk + num_internal_nodes).into_iter().rev() {
if cache.children_modified(chunk)? {
cache.modify_chunk(chunk, &cache.hash_children(chunk)?)?;
}
}
Some(chunk + num_nodes)
}
}