[][src]Function tari_mmr::pruned_mmr::prune_mmr

pub fn prune_mmr<D, B>(
    mmr: &MerkleMountainRange<D, B>
) -> Result<PrunedMmr<D>, MerkleMountainRangeError> where
    D: Digest,
    B: ArrayLike<Value = Hash>, 

Create a pruned Merkle Mountain Range from the provided MMR. Pruning entails throwing all the hashes of the pruned MMR away, except for the current peaks. A new MMR instance is returned that allows you to continue adding onto the MMR as before. Most functions of the pruned MMR will work as expected, but obviously, any leaf hashes prior to the base point won't be available. get_leaf_hash will return None for those nodes, and validate will throw an error.