pub fn index(tree: &Tree) -> Result<(), IndexMalformed>
Expand description
Verify that the inner index of the tree is correct with respect to the tree structure itself.
This is an expensive operation that requires traversing the entire tree structure, building an auxiliary reverse index, and re-hashing every leaf of the tree.
If this ever returns Err
, it indicates either a bug in this crate, or a tree that was
deserialized from an untrustworthy source.