2015-11-17 17:35:40 +01:00
|
|
|
// 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.
|
|
|
|
|
2018-04-02 00:30:17 +02:00
|
|
|
#ifndef BITCOIN_CONSENSUS_MERKLE_H
|
|
|
|
#define BITCOIN_CONSENSUS_MERKLE_H
|
2015-11-17 17:35:40 +01:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2020-03-19 23:46:56 +01:00
|
|
|
#include <primitives/block.h>
|
|
|
|
#include <uint256.h>
|
2015-11-17 17:35:40 +01:00
|
|
|
|
2018-06-04 09:11:18 +02:00
|
|
|
uint256 ComputeMerkleRoot(std::vector<uint256> hashes, bool* mutated = nullptr);
|
2015-11-17 17:35:40 +01:00
|
|
|
|
2015-11-17 17:35:44 +01:00
|
|
|
/*
|
|
|
|
* Compute the Merkle root of the transactions in a block.
|
|
|
|
* *mutated is set to true if a duplicated subtree was found.
|
|
|
|
*/
|
2019-08-06 05:08:33 +02:00
|
|
|
uint256 BlockMerkleRoot(const CBlock& block, bool* mutated = nullptr);
|
2015-11-17 17:35:44 +01:00
|
|
|
|
2018-04-02 00:30:17 +02:00
|
|
|
#endif // BITCOIN_CONSENSUS_MERKLE_H
|