aboutsummaryrefslogtreecommitdiff
path: root/src/primitives/block.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/primitives/block.h')
-rw-r--r--src/primitives/block.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/primitives/block.h b/src/primitives/block.h
index 59f46deb1c..54731ff557 100644
--- a/src/primitives/block.h
+++ b/src/primitives/block.h
@@ -21,7 +21,7 @@ class CBlockHeader
{
public:
// header
- static const int32_t CURRENT_VERSION=3;
+ static const int32_t CURRENT_VERSION=4;
int32_t nVersion;
uint256 hashPrevBlock;
uint256 hashMerkleRoot;
@@ -78,7 +78,7 @@ public:
std::vector<CTransaction> vtx;
// memory only
- mutable std::vector<uint256> vMerkleTree;
+ mutable bool fChecked;
CBlock()
{
@@ -103,7 +103,7 @@ public:
{
CBlockHeader::SetNull();
vtx.clear();
- vMerkleTree.clear();
+ fChecked = false;
}
CBlockHeader GetBlockHeader() const
@@ -118,14 +118,12 @@ public:
return block;
}
- // Build the in-memory merkle tree for this block and return the merkle root.
+ // Build the merkle tree for this block and return the merkle root.
// If non-NULL, *mutated is set to whether mutation was detected in the merkle
// tree (a duplication of transactions in the block leading to an identical
// merkle root).
- uint256 BuildMerkleTree(bool* mutated = NULL) const;
+ uint256 ComputeMerkleRoot(bool* mutated = NULL) const;
- std::vector<uint256> GetMerkleBranch(int nIndex) const;
- static uint256 CheckMerkleBranch(uint256 hash, const std::vector<uint256>& vMerkleBranch, int nIndex);
std::string ToString() const;
};