Add mix-in-len to cached tree hash

This commit is contained in:
Paul Hauner
2019-04-14 21:39:36 +10:00
parent 0632a00a48
commit ab78a15313
3 changed files with 32 additions and 1 deletions

View File

@@ -212,6 +212,12 @@ where
}
}
// If the root node or the length has changed, mix in the length of the list.
let root_node = offset_handler.root();
if cache.changed(root_node)? | (self.len() != other.len()) {
cache.modify_chunk(root_node, &cache.mix_in_length(root_node, self.len())?)?;
}
Ok(offset_handler.next_node())
}
}