Function nostr_sdk::bitcoin::merkle_tree::calculate_root
pub fn calculate_root<T, I>(hashes: I) -> Option<T>where
T: Hash + Encodable,
<T as Hash>::Engine: Write,
I: Iterator<Item = T>,Expand description
Calculates the merkle root of an iterator of hashes.
Returns
Noneifhashesis empty. The merkle root of an empty tree of hashes is undefined.Some(hash)ifhashescontains one element. A single hash is by definition the merkle root.Some(merkle_root)if length ofhashesis greater than one.