Changeset View
Changeset View
Standalone View
Standalone View
src/merkleblock.h
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | protected: | ||||
/** flag set when encountering invalid data */ | /** flag set when encountering invalid data */ | ||||
bool fBad; | bool fBad; | ||||
/** | /** | ||||
* Helper function to efficiently calculate the number of nodes at given | * Helper function to efficiently calculate the number of nodes at given | ||||
* height in the merkle tree. | * height in the merkle tree. | ||||
*/ | */ | ||||
unsigned int CalcTreeWidth(int height) { | unsigned int CalcTreeWidth(int height) const { | ||||
return (nTransactions + (1 << height) - 1) >> height; | return (nTransactions + (1 << height) - 1) >> height; | ||||
} | } | ||||
/** | /** | ||||
* Calculate the hash of a node in the merkle tree (at leaf level: the | * Calculate the hash of a node in the merkle tree (at leaf level: the | ||||
* txid's themselves) | * txid's themselves) | ||||
*/ | */ | ||||
uint256 CalcHash(int height, unsigned int pos, | uint256 CalcHash(int height, unsigned int pos, | ||||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |