breez_sdk_liquid::bitcoin::util::hash

Function bitcoin_merkle_root_inline

pub fn bitcoin_merkle_root_inline<T>(hashes: &mut [T]) -> Option<T>
where T: Hash + Encodable, <T as Hash>::Engine: Write,
Expand description

Calculates the merkle root of a list of hashes, inline (in place) in hashes.

In most cases, you’ll want to use bitcoin_merkle_root instead.

§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.