9#include <chainparams.h>
53 }
else if (
xi <= -32) {
81 if (
pblock->GetBlockTime() >
172 P = ((
P + 45037112) * x) >> 32;
173 P = ((
P + 237575834) * x) >> 32;
174 P = ((
P + 1031834945) * x) >> 32;
175 P = ((
P + 2977042554) * x) >> 32;
arith_uint256 UintToArith256(const uint256 &a)
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 CBlock & GenesisBlock() const
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 GetCompact(bool fNegative=false) const
static const uint8_t tau[]
static constexpr int64_t POW2_32
uint32_t GetNextGrasbergWorkRequired(const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const CChainParams &chainParams)
Compute the next required proof of work using a relative target based ASERT algorithm.
static constexpr int64_t LN2_32
static arith_uint256 ComputeNextTarget(const CBlockIndex *pindexTip, const CBlockIndex *pindexRef, const CChainParams ¶ms)
int64_t computeTargetBlockTime(const CBlockIndex *pindexPrev, const CChainParams &chainParams)
Compute the block time we are aiming for.
uint32_t deterministicExp2(const uint32_t n)
Computes exp2(n) = 2^32 * (2^(n/2^32) - 1)
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 nPowTargetTimespan
uint256 powLimit
Proof of work parameters.
int64_t nPowTargetSpacing
bool fPowAllowMinDifficultyBlocks