CChain

An in-memory indexed chain of blocks.

Synopsis

Declared in <chain.h>

class CChain;

Member Functions

NameDescription
CChain [constructor]Constructors
operator= [deleted]Copy assignment is deleted; chains are not copyable.
Contains Efficiently check whether a block is present in this chain.
FindEarliestAtLeast Find the earliest block with timestamp equal or greater than the given time and height equal or greater than the given height.
FindFork Find the last common block between this chain and a block index entry.
Genesis Returns the index entry for the genesis block of this chain, or nullptr if none.
Height Return the maximal height in the chain. Is equal to chain.Tip() ? chain.Tip()->nHeight : -1.
IsTipRecent Check whether this chain's tip exists, has enough work, and is recent.
Next Find the successor of a block in this chain, or nullptr if the given index is not found or is the tip.
SetTip Set/initialize a chain with a given tip.
Tip Returns the index entry for the tip of this chain, or nullptr if none.
operator[] Returns the index entry at a particular height in this chain, or nullptr if no such height exists.

Non-Member Functions

NameDescription
TestLockPointValidityTest whether the LockPoints height and time are still valid on the current chain