Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify subsidy formulas for different networks, add few comments #768

Merged
merged 1 commit into from
May 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ class CMainParams : public CChainParams {
public:
CMainParams() {
strNetworkID = "main";
consensus.nSubsidyHalvingInterval = 210240;
consensus.nSubsidyHalvingInterval = 210240; // Note: actual number of blocks per calendar year with DGW v3 is ~200700 (for example 449750 - 249050)
consensus.nMasternodePaymentsStartBlock = 100000; // not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock
consensus.nMasternodePaymentsIncreaseBlock = 158000;
consensus.nMasternodePaymentsIncreasePeriod = 576*30;
consensus.nBudgetPaymentsStartBlock = 328008;
consensus.nBudgetPaymentsCycleBlocks = 16616;
consensus.nMasternodePaymentsIncreaseBlock = 158000; // actual historical value
consensus.nMasternodePaymentsIncreasePeriod = 576*30; // 17280 - actual historical value
consensus.nBudgetPaymentsStartBlock = 328008; // actual historical value
consensus.nBudgetPaymentsCycleBlocks = 16616; // ~(60*24*30)/2.6, actual number of blocks per month is 200700 / 12 = 16725
consensus.nBudgetPaymentsWindowBlocks = 100;
consensus.nBudgetProposalEstablishingTime = 60*60*24;
consensus.nMajorityEnforceBlockUpgrade = 750;
Expand Down
29 changes: 0 additions & 29 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1516,35 +1516,6 @@ CAmount GetMasternodePayment(int nHeight, CAmount blockValue)
int nMNPIBlock = Params().GetConsensus().nMasternodePaymentsIncreaseBlock;
int nMNPIPeriod = Params().GetConsensus().nMasternodePaymentsIncreasePeriod;

// TODO: Remove this to further unify logic among mainnet/testnet/whatevernet,
// use single formula instead (the one that is for current mainnet).
// Will require testnet restart.
if(Params().NetworkIDString() == CBaseChainParams::TESTNET) {
// BUG: there had to be `return` at the end of this `if` but we continued to add mainnet %s,
// TODO: RESTART TESTNET and remove this quick fix
// ret += blockValue * 10 / 20;
// from old testnet code
if(nHeight > 46000) ret += blockValue / 20; //25% - 2014-10-07
if(nHeight > 46000+((576*1)*1)) ret += blockValue / 20; //30% - 2014-10-08
if(nHeight > 46000+((576*1)*2)) ret += blockValue / 20; //35% - 2014-10-09
if(nHeight > 46000+((576*1)*3)) ret += blockValue / 20; //40% - 2014-10-10
if(nHeight > 46000+((576*1)*4)) ret += blockValue / 20; //45% - 2014-10-11
if(nHeight > 46000+((576*1)*5)) ret += blockValue / 20; //50% - 2014-10-12
if(nHeight > 46000+((576*1)*6)) ret += blockValue / 20; //55% - 2014-10-13
if(nHeight > 46000+((576*1)*7)) ret += blockValue / 20; //60% - 2014-10-14
//from old mainnet code
if(nHeight > 158000) ret += blockValue / 20; // 158000 - 25.0% - 2014-10-24
if(nHeight > 158000+((576*30)* 1)) ret += blockValue / 20; // 175280 - 30.0% - 2014-11-25
if(nHeight > 158000+((576*30)* 2)) ret += blockValue / 20; // 192560 - 35.0% - 2014-12-26
if(nHeight > 158000+((576*30)* 3)) ret += blockValue / 40; // 209840 - 37.5% - 2015-01-26
if(nHeight > 158000+((576*30)* 4)) ret += blockValue / 40; // 227120 - 40.0% - 2015-02-27
if(nHeight > 158000+((576*30)* 5)) ret += blockValue / 40; // 244400 - 42.5% - 2015-03-30
if(nHeight > 158000+((576*30)* 6)) ret += blockValue / 40; // 261680 - 45.0% - 2015-05-01
if(nHeight > 158000+((576*30)* 7)) ret += blockValue / 40; // 278960 - 47.5% - 2015-06-01
if(nHeight > 158000+((576*30)* 9)) ret += blockValue / 40; // 313520 - 50.0% - 2015-08-03
return ret;
}

// mainnet:
if(nHeight > nMNPIBlock) ret += blockValue / 20; // 158000 - 25.0% - 2014-10-24
if(nHeight > nMNPIBlock+(nMNPIPeriod* 1)) ret += blockValue / 20; // 175280 - 30.0% - 2014-11-25
Expand Down