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;
63 assert(pindexWalk->
pprev);
64 pindexWalk = pindexWalk->
pprev;
CBlockIndex * pskip
pointer to the index of some further predecessor of this block
CBlockIndex * pprev
pointer to the index of the predecessor of this block
uint64_t nChainSize
(memory only) Size of all blocks in the chain up to and including this block.
unsigned int nChainTx
(memory only) Number of transactions in the chain up to and including this block. ...
static int GetSkipHeight(int height)
Compute what height to jump back to with the CBlockIndex::pskip pointer.
bool UpdateChainStats()
Update chain tx stats.
void BuildSkip()
Build the skiplist pointer for this entry.
unsigned int nSize
Size of this block.
The block chain is a tree shaped structure starting with the genesis block at the root...
int nHeight
height of the entry in the chain. The genesis block has height 0
CBlockIndex * GetAncestor(int height)
Efficiently find an ancestor of this block.
static int InvertLowestOne(int n)
Turn the lowest '1' bit in the binary representation of a number into a '0'.
bool HaveTxsDownloaded() const
Check whether this block's and all previous blocks' transactions have been downloaded (and stored to ...
unsigned int nTx
Number of transactions in this block.