Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
rtt.h
Go to the documentation of this file.
1// Copyright (c) 2024 The Bitcoin developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_POLICY_BLOCK_RTT_H
6#define BITCOIN_POLICY_BLOCK_RTT_H
7
9
10#include <cstdint>
11#include <optional>
12
13class CBlockIndex;
14
15namespace Consensus {
16struct Params;
17}
18
20static constexpr bool DEFAULT_ENABLE_RTT{true};
21
34
38std::optional<uint32_t>
41
43bool isRTTEnabled(const Consensus::Params &params, const CBlockIndex *pprev);
44
45#endif // BITCOIN_POLICY_BLOCK_RTT_H
const CChainParams & Params()
Return the currently selected parameters.
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition blockindex.h:25
RTTPolicy(const Consensus::Params &consensusParams, const CBlockIndex &blockIndex)
Definition rtt.h:28
const Consensus::Params & m_consensusParams
Definition rtt.h:24
bool operator()(BlockPolicyValidationState &state) override
Definition rtt.cpp:21
const CBlockIndex & m_blockIndex
Definition rtt.h:25
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...
Definition random.h:85
static constexpr bool DEFAULT_ENABLE_RTT
Default for -enablertt.
Definition rtt.h:20
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.
Definition rtt.cpp:102
bool isRTTEnabled(const Consensus::Params &params, const CBlockIndex *pprev)
Whether the RTT feature is enabled.
Definition rtt.cpp:150
Parameters that influence chain consensus.
Definition params.h:34