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.
6 #ifndef BITCOIN_CONSENSUS_PARAMS_H
7 #define BITCOIN_CONSENSUS_PARAMS_H
18 DEPLOYMENT_CSV
, // Deployment of BIP68, BIP112, and BIP113.
19 DEPLOYMENT_SEGWIT
, // Deployment of BIP141, BIP143, and BIP147.
20 // NOTE: Also add new deployments to VersionBitsDeploymentInfo in versionbits.cpp
21 MAX_VERSION_BITS_DEPLOYMENTS
25 * Struct for each individual consensus rule change using BIP9.
27 struct BIP9Deployment
{
28 /** Bit position to select the particular bit in nVersion. */
30 /** Start MedianTime for version bits miner confirmation. Can be a date in the past */
32 /** Timeout/expiry MedianTime for the deployment attempt. */
37 * Parameters that influence chain consensus.
40 uint256 hashGenesisBlock
;
41 int nSubsidyHalvingInterval
;
42 /** Block height and hash at which BIP34 becomes active */
45 /** Block height at which BIP65 becomes active */
47 /** Block height at which BIP66 becomes active */
50 * Minimum blocks including miner confirmation of the total of 2016 blocks in a retargeting period,
51 * (nPowTargetTimespan / nPowTargetSpacing) which is also used for BIP9 deployments.
52 * Examples: 1916 for 95%, 1512 for testchains.
54 uint32_t nRuleChangeActivationThreshold
;
55 uint32_t nMinerConfirmationWindow
;
56 BIP9Deployment vDeployments
[MAX_VERSION_BITS_DEPLOYMENTS
];
57 /** Proof of work parameters */
59 bool fPowAllowMinDifficultyBlocks
;
60 bool fPowNoRetargeting
;
61 int64_t nPowTargetSpacing
;
62 int64_t nPowTargetTimespan
;
63 int64_t DifficultyAdjustmentInterval() const { return nPowTargetTimespan
/ nPowTargetSpacing
; }
64 uint256 nMinimumChainWork
;
65 uint256 defaultAssumeValid
;
67 } // namespace Consensus
69 #endif // BITCOIN_CONSENSUS_PARAMS_H