Bitcoin ABC  0.29.1
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 
9 #include <primitives/blockhash.h>
10 #include <uint256.h>
11 
12 #include <chrono>
13 #include <limits>
14 
15 namespace Consensus {
16 
17 enum 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 
27 constexpr bool ValidDeployment(BuriedDeployment dep) {
28  return dep <= DEPLOYMENT_CSV;
29 }
30 
34 struct Params {
47  int CSVHeight;
51  int daaHeight;
68 
71 
74 
79  int64_t nDAAHalfLife;
82  std::chrono::seconds PowTargetSpacing() const {
83  return std::chrono::seconds{nPowTargetSpacing};
84  }
85  int64_t DifficultyAdjustmentInterval() const {
87  }
90 
92  switch (dep) {
93  case DEPLOYMENT_P2SH:
94  return BIP16Height;
96  return BIP34Height;
97  case DEPLOYMENT_CLTV:
98  return BIP65Height;
99  case DEPLOYMENT_DERSIG:
100  return BIP66Height;
101  case DEPLOYMENT_CSV:
102  return CSVHeight;
103  } // no default case, so the compiler can warn about missing cases
104  return std::numeric_limits<int>::max();
105  }
106 };
107 
108 } // namespace Consensus
109 
110 #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:89
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:73
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
int leeKuanYewActivationTime
Unix time used for MTP activation of 15 May 2024 12:00:00 UTC upgrade.
Definition: params.h:65
int64_t DifficultyAdjustmentInterval() const
Definition: params.h:85
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:79
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:78
uint256 nMinimumChainWork
Definition: params.h:88
int daaHeight
Block height at which the new DAA becomes active.
Definition: params.h:51
int64_t nPowTargetTimespan
Definition: params.h:81
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:76
int uahfHeight
Block height at which UAHF kicks in.
Definition: params.h:49
int DeploymentHeight(BuriedDeployment dep) const
Definition: params.h:91
bool enableMinerFund
Enable or disable the miner fund by default.
Definition: params.h:70
int cowperthwaiteHeight
Block height at which the Cowperthwaite activation becomes active.
Definition: params.h:63
int64_t nPowTargetSpacing
Definition: params.h:80
std::chrono::seconds PowTargetSpacing() const
Definition: params.h:82
int augustoActivationTime
Unix time used for MTP activation of 15 Nov 2024 12:00:00 UTC upgrade.
Definition: params.h:67
bool fPowAllowMinDifficultyBlocks
Definition: params.h:77