28 if (
pprev ==
nullptr) {
46 if (height >
nHeight || height < 0) {
52 while (heightWalk > height) {
55 if (pindexWalk->
pskip !=
nullptr &&
56 (heightSkip == height ||
57 (heightSkip > height && !(heightSkipPrev < heightSkip - 2 &&
58 heightSkipPrev >= height)))) {
60 pindexWalk = pindexWalk->
pskip;
61 heightWalk = heightSkip;
64 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,...
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.
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.