PRCYCoin
2.0.0.7rc1
P2P Digital Currency
src
consensus
merkle.h
Go to the documentation of this file.
1
// Copyright (c) 2015 The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#ifndef BITCOIN_MERKLE
6
#define BITCOIN_MERKLE
7
8
#include <stdint.h>
9
#include <vector>
10
11
#include "
primitives/transaction.h
"
12
#include "
primitives/block.h
"
13
#include "
uint256.h
"
14
15
uint256
ComputeMerkleRoot
(
const
std::vector<uint256>& leaves,
bool
* mutated = NULL);
16
std::vector<uint256>
ComputeMerkleBranch
(
const
std::vector<uint256>& leaves, uint32_t position);
17
uint256
ComputeMerkleRootFromBranch
(
const
uint256
& leaf,
const
std::vector<uint256>& branch, uint32_t position);
18
19
/*
20
* Compute the Merkle root of the transactions in a block.
21
* *mutated is set to true if a duplicated subtree was found.
22
*/
23
uint256
BlockMerkleRoot
(
const
CBlock
& block,
bool
* mutated = NULL);
24
25
/*
26
* Compute the Merkle branch for the tree of transactions in a block, for a
27
* given position.
28
* This can be verified using ComputeMerkleRootFromBranch.
29
*/
30
std::vector<uint256>
BlockMerkleBranch
(
const
CBlock
& block, uint32_t position);
31
32
#endif
block.h
transaction.h
BlockMerkleBranch
std::vector< uint256 > BlockMerkleBranch(const CBlock &block, uint32_t position)
Definition:
merkle.cpp:160
ComputeMerkleRoot
uint256 ComputeMerkleRoot(const std::vector< uint256 > &leaves, bool *mutated=NULL)
Definition:
merkle.cpp:125
uint256.h
ComputeMerkleBranch
std::vector< uint256 > ComputeMerkleBranch(const std::vector< uint256 > &leaves, uint32_t position)
Definition:
merkle.cpp:131
uint256
256-bit unsigned big integer.
Definition:
uint256.h:38
BlockMerkleRoot
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated=NULL)
Definition:
merkle.cpp:150
CBlock
Definition:
block.h:142
ComputeMerkleRootFromBranch
uint256 ComputeMerkleRootFromBranch(const uint256 &leaf, const std::vector< uint256 > &branch, uint32_t position)
Definition:
merkle.cpp:137
Generated on Tue Apr 28 2026 00:02:49 for PRCYCoin by
1.8.17