Implement mining slow start with a linear ramp

This commit is contained in:
Jack Grigg
2016-04-19 18:50:52 +12:00
parent c9a2eea5e2
commit bcb34c0802
3 changed files with 32 additions and 2 deletions

View File

@@ -14,6 +14,20 @@ namespace Consensus {
*/
struct Params {
uint256 hashGenesisBlock;
/** Needs to evenly divide MAX_SUBSIDY to avoid rounding errors. */
int nSubsidySlowStartInterval;
/**
* Shift based on a linear ramp for slow start:
*
* MAX_SUBSIDY*(t_s/2 + t/r) = MAX_SUBSIDY*t_h Coin balance
* t_s + t_r = t_h + t_c Block balance
*
* t_s = nSubsidySlowStartInterval
* t_r = number of blocks between end of slow start and first halving
* t_h = nSubsidyHalvingInterval
* t_c = SubsidySlowStartShift()
*/
int SubsidySlowStartShift() const { return nSubsidySlowStartInterval / 2; }
int nSubsidyHalvingInterval;
/** Used to check majorities for block version upgrade */
int nMajorityEnforceBlockUpgrade;