]>
Commit | Line | Data |
---|---|---|
bd006110 JT |
1 | // Copyright (c) 2009-2010 Satoshi Nakamoto |
2 | // Copyright (c) 2009-2014 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 | ||
a21df620 PK |
6 | #ifndef BITCOIN_CONSENSUS_PARAMS_H |
7 | #define BITCOIN_CONSENSUS_PARAMS_H | |
bd006110 | 8 | |
bd006110 JT |
9 | #include "uint256.h" |
10 | ||
11 | namespace Consensus { | |
12 | /** | |
13 | * Parameters that influence chain consensus. | |
14 | */ | |
15 | struct Params { | |
16 | uint256 hashGenesisBlock; | |
bcb34c08 JG |
17 | /** Needs to evenly divide MAX_SUBSIDY to avoid rounding errors. */ |
18 | int nSubsidySlowStartInterval; | |
19 | /** | |
20 | * Shift based on a linear ramp for slow start: | |
21 | * | |
068e2f1a JG |
22 | * MAX_SUBSIDY*(t_s/2 + t_r) = MAX_SUBSIDY*t_h Coin balance |
23 | * t_s + t_r = t_h + t_c Block balance | |
bcb34c08 JG |
24 | * |
25 | * t_s = nSubsidySlowStartInterval | |
26 | * t_r = number of blocks between end of slow start and first halving | |
27 | * t_h = nSubsidyHalvingInterval | |
28 | * t_c = SubsidySlowStartShift() | |
29 | */ | |
30 | int SubsidySlowStartShift() const { return nSubsidySlowStartInterval / 2; } | |
bd006110 JT |
31 | int nSubsidyHalvingInterval; |
32 | /** Used to check majorities for block version upgrade */ | |
33 | int nMajorityEnforceBlockUpgrade; | |
34 | int nMajorityRejectBlockOutdated; | |
35 | int nMajorityWindow; | |
36 | /** Proof of work parameters */ | |
fd311996 | 37 | uint256 powLimit; |
bd006110 JT |
38 | bool fPowAllowMinDifficultyBlocks; |
39 | int64_t nPowTargetSpacing; | |
40 | int64_t nPowTargetTimespan; | |
41 | int64_t DifficultyAdjustmentInterval() const { return nPowTargetTimespan / nPowTargetSpacing; } | |
42 | }; | |
43 | } // namespace Consensus | |
44 | ||
a21df620 | 45 | #endif // BITCOIN_CONSENSUS_PARAMS_H |