30 "CBlockIndex(pprev=%p, nHeight=%d, merkle=%s, hashBlock=%s)",
pprev,
35 if (
pprev ==
nullptr) {
53 if (height >
nHeight || height < 0) {
static int GetSkipHeight(int height)
Compute what height to jump back to with the CBlockIndex::pskip pointer.
static int InvertLowestOne(int n)
Turn the lowest '1' bit in the binary representation of a number into a '0'.
The block chain is a tree shaped structure starting with the genesis block at the root,...
std::string ToString() const
CBlockIndex * pprev
pointer to the index of the predecessor of this block
void BuildSkip()
Build the skiplist pointer for this entry.
uint64_t nChainSize
(memory only) Size of all blocks in the chain up to and including this block.
bool UpdateChainStats()
Update chain tx stats.
CBlockIndex * pskip
pointer to the index of some further predecessor of this block
unsigned int nTx
Number of transactions in this block.
CBlockIndex * GetAncestor(int height)
Efficiently find an ancestor of this block.
BlockHash GetBlockHash() const
unsigned int nSize
Size of this block.
int nHeight
height of the entry in the chain. The genesis block has height 0
unsigned int nChainTx
(memory only) Number of transactions in the chain up to and including this block.
std::string ToString() const
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...