62 blocks[1] = pindex->
pprev;
63 blocks[0] = blocks[1]->
pprev;
66 if (blocks[0]->nTime > blocks[2]->nTime) {
67 std::swap(blocks[0], blocks[2]);
70 if (blocks[0]->nTime > blocks[1]->nTime) {
71 std::swap(blocks[0], blocks[1]);
74 if (blocks[1]->nTime > blocks[2]->nTime) {
75 std::swap(blocks[1], blocks[2]);
arith_uint256 UintToArith256(const uint256 &a)
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
int nHeight
height of the entry in the chain. The genesis block has height 0
256-bit unsigned big integer.
uint32_t GetCompact(bool fNegative=false) const
static arith_uint256 ComputeTarget(const CBlockIndex *pindexFirst, const CBlockIndex *pindexLast, const Consensus::Params ¶ms)
Compute a target based on the work done between 2 blocks and the time required to produce that work.
uint32_t GetNextDAAWorkRequired(const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const Consensus::Params ¶ms)
Compute the next required proof of work using a weighted average of the estimated hashrate per block.
static const CBlockIndex * GetSuitableBlock(const CBlockIndex *pindex)
To reduce the impact of timestamp manipulation, we select the block we are basing our computation on ...
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...
Parameters that influence chain consensus.
int64_t DifficultyAdjustmentInterval() const
uint256 powLimit
Proof of work parameters.
int64_t nPowTargetSpacing
bool fPowAllowMinDifficultyBlocks