11#include <chainparams.h>
25 assert(pindexPrev !=
nullptr);
31 return pindexPrev->
nBits;
48 int64_t height, uint32_t old_nbits,
59 if (old_nbits == new_nbits) {
107 target.
SetCompact(nBits, &fNegative, &fOverflow);
109 return !(fNegative || target == 0 || fOverflow ||
bool IsDAAEnabled(const Consensus::Params ¶ms, int nHeight)
bool IsUAHFenabled(const Consensus::Params ¶ms, int nHeight)
static bool IsAxionEnabled(const Consensus::Params ¶ms, int32_t nHeight)
arith_uint256 UintToArith256(const uint256 &a)
uint32_t GetNextASERTWorkRequired(const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const Consensus::Params ¶ms) noexcept
The block chain is a tree shaped structure starting with the genesis block at the root,...
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
const Consensus::Params & GetConsensus() const
256-bit unsigned big integer.
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...
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.
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...
bool PermittedEDADifficultyTransition(const Consensus::Params ¶ms, uint32_t old_nbits, arith_uint256 new_target)
Return false if the proof-of-work requirement specified by new_target is not possible,...
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.
bool PermittedDifficultyTransition(const Consensus::Params ¶ms, int64_t height, uint32_t old_nbits, uint32_t new_nbits)
Return false if the proof-of-work requirement specified by new_nbits at a given height is not possibl...
uint32_t GetNextWorkRequired(const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const CChainParams &chainParams)
bool NBitsToTarget(const Consensus::Params ¶ms, uint32_t nBits, arith_uint256 &target)
Convert a header bits difficulty representation to a 256 bits hash target.
A BlockHash is a unqiue identifier for a block.
Parameters that influence chain consensus.
int64_t DifficultyAdjustmentInterval() const
uint256 powLimit
Proof of work parameters.
bool fPowAllowMinDifficultyBlocks