[#ComputeMerkleRoot]
= ComputeMerkleRoot
:mrdocs:

Compute a Merkle root from the provided leaf hashes&period; If non&hyphen;null, `&ast;mutated` is set to true if two identical hashes are paired at any tree level before the odd&hyphen;count hash duplication step, and false otherwise&period;

== Synopsis

Declared in `&lt;consensus&sol;merkle&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:uint256.adoc[uint256]
ComputeMerkleRoot(
    std::vector&lt;uint256&gt; hashes,
    bool* mutated = nullptr);
----

== Return Value

The Merkle root of the given hashes&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *hashes*
| The leaf hashes to build the tree from&period;
| *mutated*
| If non&hyphen;null, receives whether a pair of identical hashes was detected&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
