42 "Block %s at height %d violates the real time target %08x (%s "
43 "> %s, time diff %ds)\n",
78static constexpr double RTT_K{6.};
82 std::pow(600.,
RTT_K - 1.);
85 std::pow(2400.,
RTT_K - 1.);
88 std::pow(6000.,
RTT_K - 1.);
91 std::pow(9600.,
RTT_K - 1.);
101std::optional<uint32_t>
108 for (
size_t i = 1; i < 18; i++) {
130 for (
size_t i : {2, 5, 11, 17}) {
bool IsAugustoEnabled(const Consensus::Params ¶ms, int64_t nMedianTimePast)
Check if May 15th, 2024 protocol upgrade has activated.
arith_uint256 UintToArith256(const uint256 &a)
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
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
int64_t GetHeaderReceivedTime() const
BlockHash GetBlockHash() const
int nHeight
height of the entry in the chain. The genesis block has height 0
const Consensus::Params & m_consensusParams
bool operator()(BlockPolicyValidationState &state) override
const CBlockIndex & m_blockIndex
bool Invalid(Result result, const std::string &reject_reason="", const std::string &debug_message="")
256-bit unsigned big integer.
static arith_uint256 fromDouble(double d)
std::string ToString() const
std::string ToString() const
@ POLICY_VIOLATION
A block policy rule was violated. This block should be parked.
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 NBitsToTarget(const Consensus::Params ¶ms, uint32_t nBits, arith_uint256 &target)
Convert a header bits difficulty representation to a 256 bits hash target.
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...
static const double RTT_CONSTANT_FACTOR_5
static const std::vector< double > RTT_CONSTANT_FACTOR
std::optional< uint32_t > GetNextRTTWorkRequired(const CBlockIndex *pprev, int64_t now, const Consensus::Params &consensusParams)
Compute the real time block hash target given the previous block parameters.
static const double RTT_CONSTANT_FACTOR_11
bool isRTTEnabled(const Consensus::Params ¶ms, const CBlockIndex *pprev)
Whether the RTT feature is enabled.
static const double RTT_CONSTANT_FACTOR_17
static const double RTT_CONSTANT_FACTOR_2
static constexpr double RTT_K
target(t) = target(prev_block) * RTT_CONSTANT_FACTOR * t^(RTT_K - 1) Where t is the time since the pr...
static constexpr bool DEFAULT_ENABLE_RTT
Default for -enablertt.
std::optional< uint32_t > GetNextRTTWorkRequired(const CBlockIndex *pprev, int64_t now, const Consensus::Params &consensusParams)
Compute the real time block hash target given the previous block parameters.
bool isRTTEnabled(const Consensus::Params ¶ms, const CBlockIndex *pprev)
Whether the RTT feature is enabled.
Parameters that influence chain consensus.