Bitcoin Core  0.21.1
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules
params.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2019 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 <uint256.h>
10 #include <limits>
11 
12 namespace Consensus {
13 
15 {
17  DEPLOYMENT_TAPROOT, // Deployment of Schnorr/Taproot (BIPs 340-342)
18  // NOTE: Also add new deployments to VersionBitsDeploymentInfo in versionbits.cpp
20 };
21 
27  int bit;
29  int64_t nStartTime;
31  int64_t nTimeout;
37 
39  static constexpr int64_t NO_TIMEOUT = std::numeric_limits<int64_t>::max();
40 
45  static constexpr int64_t ALWAYS_ACTIVE = -1;
46 
50  static constexpr int64_t NEVER_ACTIVE = -2;
51 };
52 
56 struct Params {
59  /* Block hash that is excepted from BIP16 enforcement */
69  int CSVHeight;
91  int64_t DifficultyAdjustmentInterval() const { return nPowTargetTimespan / nPowTargetSpacing; }
96 
101  bool signet_blocks{false};
102  std::vector<uint8_t> signet_challenge;
103 };
104 } // namespace Consensus
105 
106 #endif // BITCOIN_CONSENSUS_PARAMS_H
static constexpr int64_t NO_TIMEOUT
Constant for nTimeout very far in the future.
Definition: params.h:39
int min_activation_height
If lock in occurs, delay activation until at least this block height.
Definition: params.h:36
uint256 BIP34Hash
Definition: params.h:63
int64_t nPowTargetTimespan
Definition: params.h:90
bool fPowNoRetargeting
Definition: params.h:88
bool fPowAllowMinDifficultyBlocks
Definition: params.h:87
static constexpr int64_t ALWAYS_ACTIVE
Special value for nStartTime indicating that the deployment is always active.
Definition: params.h:45
int BIP66Height
Block height at which BIP66 becomes active.
Definition: params.h:67
int64_t DifficultyAdjustmentInterval() const
Definition: params.h:91
int CSVHeight
Block height at which CSV (BIP68, BIP112 and BIP113) becomes active.
Definition: params.h:69
Transaction validation functions.
Definition: params.h:12
int nSubsidyHalvingInterval
Definition: params.h:58
uint256 powLimit
Proof of work parameters.
Definition: params.h:86
DeploymentPos
Definition: params.h:14
Struct for each individual consensus rule change using BIP9.
Definition: params.h:25
int BIP34Height
Block height and hash at which BIP34 becomes active.
Definition: params.h:62
int64_t nStartTime
Start MedianTime for version bits miner confirmation.
Definition: params.h:29
uint256 BIP16Exception
Definition: params.h:60
int64_t nPowTargetSpacing
Definition: params.h:89
bool signet_blocks
If true, witness commitments contain a payload equal to a Bitcoin Script solution to the signet chall...
Definition: params.h:101
static constexpr int64_t NEVER_ACTIVE
Special value for nStartTime indicating that the deployment is never active.
Definition: params.h:50
uint32_t nMinerConfirmationWindow
Definition: params.h:83
Parameters that influence chain consensus.
Definition: params.h:56
int BIP65Height
Block height at which BIP65 becomes active.
Definition: params.h:65
int64_t nTimeout
Timeout/expiry MedianTime for the deployment attempt.
Definition: params.h:31
256-bit opaque blob.
Definition: uint256.h:124
uint256 nMinimumChainWork
The best chain should have at least this much work.
Definition: params.h:93
uint256 defaultAssumeValid
By default assume that the signatures in ancestors of this block are valid.
Definition: params.h:95
std::vector< uint8_t > signet_challenge
Definition: params.h:102
int MinBIP9WarningHeight
Don't warn about unknown BIP 9 activations below this height.
Definition: params.h:76
uint32_t nRuleChangeActivationThreshold
Minimum blocks including miner confirmation of the total of 2016 blocks in a retargeting period...
Definition: params.h:82
int SegwitHeight
Block height at which Segwit (BIP141, BIP143 and BIP147) becomes active.
Definition: params.h:73
int bit
Bit position to select the particular bit in nVersion.
Definition: params.h:27
uint256 hashGenesisBlock
Definition: params.h:57
BIP9Deployment vDeployments[MAX_VERSION_BITS_DEPLOYMENTS]
Definition: params.h:84