Bitcoin ABC 0.30.9
P2P Digital Currency
params.h
Go to the documentation of this file.
1// Copyright (c) 2009-2010 Satoshi Nakamoto
2// Copyright (c) 2009-2016 The Bitcoin Core developers
3// Distributed under the MIT software license, see the accompanying
4// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6#ifndef BITCOIN_CONSENSUS_PARAMS_H
7#define BITCOIN_CONSENSUS_PARAMS_H
8
10#include <uint256.h>
11
12#include <chrono>
13#include <limits>
14
15namespace Consensus {
16
17enum BuriedDeployment : int16_t {
18 // buried deployments get negative values to avoid overlap with
19 // DeploymentPos
20 DEPLOYMENT_P2SH = std::numeric_limits<int16_t>::min(),
25};
26
27constexpr bool ValidDeployment(BuriedDeployment dep) {
28 return dep <= DEPLOYMENT_CSV;
29}
30
34struct Params {
66
69
72
77 int64_t nDAAHalfLife;
80 std::chrono::seconds PowTargetSpacing() const {
81 return std::chrono::seconds{nPowTargetSpacing};
82 }
85 }
88
90 switch (dep) {
91 case DEPLOYMENT_P2SH:
92 return BIP16Height;
94 return BIP34Height;
95 case DEPLOYMENT_CLTV:
96 return BIP65Height;
98 return BIP66Height;
99 case DEPLOYMENT_CSV:
100 return CSVHeight;
101 } // no default case, so the compiler can warn about missing cases
102 return std::numeric_limits<int>::max();
103 }
104};
105
106} // namespace Consensus
107
108#endif // BITCOIN_CONSENSUS_PARAMS_H
256-bit opaque blob.
Definition: uint256.h:129
constexpr bool ValidDeployment(BuriedDeployment dep)
Definition: params.h:27
BuriedDeployment
Definition: params.h:17
@ DEPLOYMENT_DERSIG
Definition: params.h:23
@ DEPLOYMENT_P2SH
Definition: params.h:20
@ DEPLOYMENT_CSV
Definition: params.h:24
@ DEPLOYMENT_HEIGHTINCB
Definition: params.h:21
@ DEPLOYMENT_CLTV
Definition: params.h:22
A BlockHash is a unqiue identifier for a block.
Definition: blockhash.h:13
Parameters that influence chain consensus.
Definition: params.h:34
BlockHash defaultAssumeValid
Definition: params.h:87
int magneticAnomalyHeight
Block height at which the magnetic anomaly activation becomes active.
Definition: params.h:53
int BIP65Height
Block height at which BIP65 becomes active.
Definition: params.h:43
bool enableStakingRewards
Enable or disable the staking rewards by default.
Definition: params.h:71
int CSVHeight
Block height at which CSV (BIP68, BIP112 and BIP113) becomes active.
Definition: params.h:47
int gravitonHeight
Block height at which the graviton activation becomes active.
Definition: params.h:55
int axionHeight
Block height at which the axion activation becomes active.
Definition: params.h:59
int64_t DifficultyAdjustmentInterval() const
Definition: params.h:83
BlockHash BIP34Hash
Definition: params.h:41
int BIP16Height
Block height at which BIP16 becomes active.
Definition: params.h:38
int wellingtonHeight
Block height at which the wellington activation becomes active.
Definition: params.h:61
int phononHeight
Block height at which the phonon activation becomes active.
Definition: params.h:57
int64_t nDAAHalfLife
Definition: params.h:77
int BIP34Height
Block height and hash at which BIP34 becomes active.
Definition: params.h:40
int nSubsidyHalvingInterval
Definition: params.h:36
bool fPowNoRetargeting
Definition: params.h:76
uint256 nMinimumChainWork
Definition: params.h:86
int daaHeight
Block height at which the new DAA becomes active.
Definition: params.h:51
int64_t nPowTargetTimespan
Definition: params.h:79
BlockHash hashGenesisBlock
Definition: params.h:35
int BIP66Height
Block height at which BIP66 becomes active.
Definition: params.h:45
uint256 powLimit
Proof of work parameters.
Definition: params.h:74
int schumpeterActivationTime
Unix time used for MTP activation of 15 May 2025 12:00:00 UTC upgrade.
Definition: params.h:65
int uahfHeight
Block height at which UAHF kicks in.
Definition: params.h:49
int DeploymentHeight(BuriedDeployment dep) const
Definition: params.h:89
bool enableMinerFund
Enable or disable the miner fund by default.
Definition: params.h:68
int cowperthwaiteHeight
Block height at which the Cowperthwaite activation becomes active.
Definition: params.h:63
int64_t nPowTargetSpacing
Definition: params.h:78
std::chrono::seconds PowTargetSpacing() const
Definition: params.h:80
bool fPowAllowMinDifficultyBlocks
Definition: params.h:75