Function bdk_chain::bitcoin::merkle_tree::calculate_root_inline
pub fn calculate_root_inline<T>(hashes: &mut [T]) -> Option<T>
Expand description
Calculates the merkle root of a list of hashes, inline (in place) in hashes
.
In most cases, you’ll want to use calculate_root
instead. Please note, calling this function
trashes the data in hashes
(i.e. the hashes
is left in an undefined state at conclusion of
this method and should not be used again afterwards).
§Returns
None
ifhashes
is empty. The merkle root of an empty tree of hashes is undefined.Some(hash)
ifhashes
contains one element. A single hash is by definition the merkle root.Some(merkle_root)
if length ofhashes
is greater than one.