Function breez_sdk_liquid::bitcoin::util::hash::bitcoin_merkle_root

pub fn bitcoin_merkle_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

  • None if hashes is empty. The merkle root of an empty tree of hashes is undefined.
  • Some(hash) if hashes contains one element. A single hash is by definition the merkle root.
  • Some(merkle_root) if length of hashes is greater than one.