25 assert(pindexPrev !=
nullptr);
31 return pindexPrev->
nBits;
51 bnTarget.
SetCompact(nBits, &fNegative, &fOverflow);
54 if (fNegative || bnTarget == 0 || fOverflow ||
bool IsAxionEnabled(const Consensus::Params ¶ms, const CBlockIndex *pindexPrev)
Check if November 15th, 2020 protocol upgrade has activated.
uint32_t GetNextASERTWorkRequired(const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const Consensus::Params ¶ms) noexcept
uint32_t GetNextEDAWorkRequired(const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const Consensus::Params ¶ms)
Compute the next required proof of work using the legacy Bitcoin difficulty adjustment + Emergency Di...
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system...
static bool IsDAAEnabled(const Consensus::Params ¶ms, int nHeight)
arith_uint256 UintToArith256(const uint256 &a)
uint256 powLimit
Proof of work parameters.
Parameters that influence chain consensus.
256-bit unsigned big integer.
uint32_t GetNextWorkRequired(const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const CChainParams &chainParams)
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...
bool CheckProofOfWork(const BlockHash &hash, uint32_t nBits, const Consensus::Params ¶ms)
Check whether a block hash satisfies the proof-of-work requirement specified by nBits.
A BlockHash is a unqiue identifier for a block.
The block chain is a tree shaped structure starting with the genesis block at the root...
arith_uint256 & SetCompact(uint32_t nCompact, bool *pfNegative=nullptr, bool *pfOverflow=nullptr)
The "compact" format is a representation of a whole number N using an unsigned 32bit number similar t...
const Consensus::Params & GetConsensus() const