Bitcoin ABC  0.26.3
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 <limits>
13 
14 namespace Consensus {
15 
16 enum BuriedDeployment : int16_t {
17  // buried deployments get negative values to avoid overlap with
18  // DeploymentPos
19  DEPLOYMENT_P2SH = std::numeric_limits<int16_t>::min(),
24 };
25 
26 constexpr bool ValidDeployment(BuriedDeployment dep) {
27  return dep <= DEPLOYMENT_CSV;
28 }
29 
33 struct Params {
46  int CSVHeight;
50  int daaHeight;
67 
70 
75  int64_t nDAAHalfLife;
78  int64_t DifficultyAdjustmentInterval() const {
80  }
83 
85  switch (dep) {
86  case DEPLOYMENT_P2SH:
87  return BIP16Height;
89  return BIP34Height;
90  case DEPLOYMENT_CLTV:
91  return BIP65Height;
92  case DEPLOYMENT_DERSIG:
93  return BIP66Height;
94  case DEPLOYMENT_CSV:
95  return CSVHeight;
96  } // no default case, so the compiler can warn about missing cases
97  return std::numeric_limits<int>::max();
98  }
99 };
100 
101 } // namespace Consensus
102 
103 #endif // BITCOIN_CONSENSUS_PARAMS_H
256-bit opaque blob.
Definition: uint256.h:127
constexpr bool ValidDeployment(BuriedDeployment dep)
Definition: params.h:26
BuriedDeployment
Definition: params.h:16
@ DEPLOYMENT_DERSIG
Definition: params.h:22
@ DEPLOYMENT_P2SH
Definition: params.h:19
@ DEPLOYMENT_CSV
Definition: params.h:23
@ DEPLOYMENT_HEIGHTINCB
Definition: params.h:20
@ DEPLOYMENT_CLTV
Definition: params.h:21
A BlockHash is a unqiue identifier for a block.
Definition: blockhash.h:13
Parameters that influence chain consensus.
Definition: params.h:33
BlockHash defaultAssumeValid
Definition: params.h:82
int magneticAnomalyHeight
Block height at which the magnetic anomaly activation becomes active.
Definition: params.h:52
int BIP65Height
Block height at which BIP65 becomes active.
Definition: params.h:42
int CSVHeight
Block height at which CSV (BIP68, BIP112 and BIP113) becomes active.
Definition: params.h:46
int gravitonHeight
Block height at which the graviton activation becomes active.
Definition: params.h:54
int axionHeight
Block height at which the axion activation becomes active.
Definition: params.h:58
int wellingtonActivationTime
Unix time used for MTP activation of 15 May 2023 12:00:00 UTC upgrade.
Definition: params.h:64
int gluonHeight
Block height at which the gluon activation becomes active.
Definition: params.h:60
int64_t DifficultyAdjustmentInterval() const
Definition: params.h:78
BlockHash BIP34Hash
Definition: params.h:40
int BIP16Height
Block height at which BIP16 becomes active.
Definition: params.h:37
int phononHeight
Block height at which the phonon activation becomes active.
Definition: params.h:56
int64_t nDAAHalfLife
Definition: params.h:75
int jeffersonActivationTime
Unix time used for MTP activation of 15 Nov 2022 12:00:00 UTC upgrade.
Definition: params.h:62
int BIP34Height
Block height and hash at which BIP34 becomes active.
Definition: params.h:39
int nSubsidyHalvingInterval
Definition: params.h:35
int cowperthwaiteActivationTime
Unix time used for MTP activation of 15 Nov 2023 12:00:00 UTC upgrade.
Definition: params.h:66
bool fPowNoRetargeting
Definition: params.h:74
uint256 nMinimumChainWork
Definition: params.h:81
int daaHeight
Block height at which the new DAA becomes active.
Definition: params.h:50
int64_t nPowTargetTimespan
Definition: params.h:77
BlockHash hashGenesisBlock
Definition: params.h:34
int BIP66Height
Block height at which BIP66 becomes active.
Definition: params.h:44
uint256 powLimit
Proof of work parameters.
Definition: params.h:72
int uahfHeight
Block height at which UAHF kicks in.
Definition: params.h:48
int DeploymentHeight(BuriedDeployment dep) const
Definition: params.h:84
bool enableMinerFund
Enable or disable the miner fund by default.
Definition: params.h:69
int64_t nPowTargetSpacing
Definition: params.h:76
bool fPowAllowMinDifficultyBlocks
Definition: params.h:73