LCOV - code coverage report
Current view: top level - src/consensus - params.h (source / functions) Hit Total Coverage
Test: bitcoincash_test.info Lines: 1 1 100.0 %
Date: 2018-04-13 15:12:50 Functions: 2 2 100.0 %

          Line data    Source code
       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 "uint256.h"
      10             : 
      11             : #include <map>
      12             : #include <string>
      13             : 
      14             : namespace Consensus {
      15             : 
      16             : enum DeploymentPos {
      17             :     DEPLOYMENT_TESTDUMMY,
      18             :     // Deployment of BIP68, BIP112, and BIP113.
      19             :     DEPLOYMENT_CSV,
      20             :     // NOTE: Also add new deployments to VersionBitsDeploymentInfo in
      21             :     // versionbits.cpp
      22             :     MAX_VERSION_BITS_DEPLOYMENTS
      23             : };
      24             : 
      25             : /**
      26             :  * Struct for each individual consensus rule change using BIP9.
      27             :  */
      28             : struct BIP9Deployment {
      29             :     /** Bit position to select the particular bit in nVersion. */
      30             :     int bit;
      31             :     /** Start MedianTime for version bits miner confirmation. Can be a date in
      32             :      * the past */
      33             :     int64_t nStartTime;
      34             :     /** Timeout/expiry MedianTime for the deployment attempt. */
      35             :     int64_t nTimeout;
      36             : };
      37             : 
      38             : /**
      39             :  * Parameters that influence chain consensus.
      40             :  */
      41         853 : struct Params {
      42             :     uint256 hashGenesisBlock;
      43             :     int nSubsidyHalvingInterval;
      44             :     /** Block height and hash at which BIP34 becomes active */
      45             :     int BIP34Height;
      46             :     uint256 BIP34Hash;
      47             :     /** Block height at which BIP65 becomes active */
      48             :     int BIP65Height;
      49             :     /** Block height at which BIP66 becomes active */
      50             :     int BIP66Height;
      51             :     /** Block height at which UAHF kicks in */
      52             :     int uahfHeight;
      53             :     /** Block height at which the new DAA becomes active */
      54             :     int daaHeight;
      55             :     /** Unix time used for MTP activation of May 15 2018, hardfork */
      56             :     int monolithActivationTime;
      57             :     /** Unix time used for MTP activation of Nov 15 2018, hardfork */
      58             :     int magneticAnomalyActivationTime;
      59             :     /** Block height at which OP_RETURN replay protection stops */
      60             :     int antiReplayOpReturnSunsetHeight;
      61             :     /** Committed OP_RETURN value for replay protection */
      62             :     std::vector<uint8_t> antiReplayOpReturnCommitment;
      63             :     /**
      64             :      * Minimum blocks including miner confirmation of the total of 2016 blocks
      65             :      * in a retargeting period, (nPowTargetTimespan / nPowTargetSpacing) which
      66             :      * is also used for BIP9 deployments.
      67             :      * Examples: 1916 for 95%, 1512 for testchains.
      68             :      */
      69             :     uint32_t nRuleChangeActivationThreshold;
      70             :     uint32_t nMinerConfirmationWindow;
      71             :     BIP9Deployment vDeployments[MAX_VERSION_BITS_DEPLOYMENTS];
      72             :     /** Proof of work parameters */
      73             :     uint256 powLimit;
      74             :     bool fPowAllowMinDifficultyBlocks;
      75             :     bool fPowNoRetargeting;
      76             :     int64_t nPowTargetSpacing;
      77             :     int64_t nPowTargetTimespan;
      78             :     int64_t DifficultyAdjustmentInterval() const {
      79             :         return nPowTargetTimespan / nPowTargetSpacing;
      80             :     }
      81             :     uint256 nMinimumChainWork;
      82             :     uint256 defaultAssumeValid;
      83             : };
      84             : } // namespace Consensus
      85             : 
      86             : #endif // BITCOIN_CONSENSUS_PARAMS_H

Generated by: LCOV version 1.12