您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Copyright (c) 2009-2010 Satoshi Nakamoto
  2. // Copyright (c) 2009-2015 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. #ifndef BITCOIN_CONSENSUS_PARAMS_H
  6. #define BITCOIN_CONSENSUS_PARAMS_H
  7. #include "uint256.h"
  8. #include <map>
  9. #include <string>
  10. namespace Consensus {
  11. enum DeploymentPos
  12. {
  13. MAX_VERSION_BITS_DEPLOYMENTS = 0,
  14. };
  15. /**
  16. * Struct for each individual consensus rule change using BIP9.
  17. */
  18. struct BIP9Deployment {
  19. /** Bit position to select the particular bit in nVersion. */
  20. int bit;
  21. /** Start MedianTime for version bits miner confirmation. Can be a date in the past */
  22. int64_t nStartTime;
  23. /** Timeout/expiry MedianTime for the deployment attempt. */
  24. int64_t nTimeout;
  25. };
  26. /**
  27. * Parameters that influence chain consensus.
  28. */
  29. struct Params {
  30. uint256 hashGenesisBlock;
  31. int nSubsidyHalvingInterval;
  32. /** Used to check majorities for block version upgrade */
  33. int nMajorityEnforceBlockUpgrade;
  34. int nMajorityRejectBlockOutdated;
  35. int nMajorityWindow;
  36. /** Block height and hash at which BIP34 becomes active */
  37. int BIP34Height;
  38. uint256 BIP34Hash;
  39. /**
  40. * Minimum blocks including miner confirmation of the total of 2016 blocks in a retargetting period,
  41. * (nPowTargetTimespan / nPowTargetSpacing) which is also used for BIP9 deployments.
  42. * Examples: 1916 for 95%, 1512 for testchains.
  43. */
  44. uint32_t nRuleChangeActivationThreshold;
  45. uint32_t nMinerConfirmationWindow;
  46. BIP9Deployment vDeployments[MAX_VERSION_BITS_DEPLOYMENTS];
  47. /** Proof of work parameters */
  48. uint256 powLimit;
  49. bool fPowAllowMinDifficultyBlocks;
  50. bool fPowNoRetargeting;
  51. int64_t nPowTargetSpacing;
  52. int64_t nPowTargetTimespan;
  53. int64_t DifficultyAdjustmentInterval() const { return nPowTargetTimespan / nPowTargetSpacing; }
  54. };
  55. } // namespace Consensus
  56. #endif // BITCOIN_CONSENSUS_PARAMS_H