30 "CBlockIndex(pprev=%p, nHeight=%d, merkle=%s, hashBlock=%s)",
pprev,
35 if (
pprev ==
nullptr) {
53 if (height >
nHeight || height < 0) {
59 while (heightWalk > height) {
62 if (pindexWalk->
pskip !=
nullptr &&
63 (heightSkip == height ||
64 (heightSkip > height && !(heightSkipPrev < heightSkip - 2 &&
65 heightSkipPrev >= height)))) {
67 pindexWalk = pindexWalk->
pskip;
68 heightWalk = heightSkip;
71 pindexWalk = pindexWalk->
pprev;
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