From ee60e5625bf8a11c8e5509b9cea8b6465056c448 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 17 Nov 2015 17:35:40 +0100 Subject: Add merkle.{h,cpp}, generic merkle root/branch algorithm --- src/consensus/merkle.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/consensus/merkle.h (limited to 'src/consensus/merkle.h') diff --git a/src/consensus/merkle.h b/src/consensus/merkle.h new file mode 100644 index 0000000000..7fd13d3e43 --- /dev/null +++ b/src/consensus/merkle.h @@ -0,0 +1,17 @@ +// Copyright (c) 2015 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_MERKLE +#define BITCOIN_MERKLE + +#include +#include + +#include "uint256.h" + +uint256 ComputeMerkleRoot(const std::vector& leaves, bool* mutated = NULL); +std::vector ComputeMerkleBranch(const std::vector& leaves, uint32_t position); +uint256 ComputeMerkleRootFromBranch(const uint256& leaf, const std::vector& branch, uint32_t position); + +#endif -- cgit v1.2.3