Skip to content

Commit

Permalink
Refactor: Move MN block reward to chainparams.
Browse files Browse the repository at this point in the history
Github-Pull: bitcoin#2671
Rebased-From: d3ca538
  • Loading branch information
furszy committed Dec 11, 2021
1 parent 1a55752 commit 139596e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class CMainParams : public CChainParams
consensus.nFutureTimeDriftPoS = 180;
consensus.nMaxMoneyOut = 21000000 * COIN;
consensus.nMNCollateralAmt = 10000 * COIN;
consensus.nMNBlockReward = 3 * COIN;
consensus.nProposalEstablishmentTime = 60 * 60 * 24; // must be at least a day old to make it into a budget
consensus.nStakeMinAge = 60 * 60;
consensus.nStakeMinDepth = 600;
Expand Down Expand Up @@ -290,6 +291,7 @@ class CTestNetParams : public CChainParams
consensus.nFutureTimeDriftPoS = 180;
consensus.nMaxMoneyOut = 21000000 * COIN;
consensus.nMNCollateralAmt = 10000 * COIN;
consensus.nMNBlockReward = 3 * COIN;
consensus.nProposalEstablishmentTime = 60 * 5; // at least 5 min old to make it into a budget
consensus.nStakeMinAge = 60 * 60;
consensus.nStakeMinDepth = 100;
Expand Down Expand Up @@ -415,6 +417,7 @@ class CRegTestParams : public CChainParams
consensus.nFutureTimeDriftPoS = 180;
consensus.nMaxMoneyOut = 43199500 * COIN;
consensus.nMNCollateralAmt = 100 * COIN;
consensus.nMNBlockReward = 3 * COIN;
consensus.nProposalEstablishmentTime = 60 * 5; // at least 5 min old to make it into a budget
consensus.nStakeMinAge = 0;
consensus.nStakeMinDepth = 20;
Expand Down
1 change: 1 addition & 0 deletions src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ struct Params {
int nFutureTimeDriftPoS;
CAmount nMaxMoneyOut;
CAmount nMNCollateralAmt;
CAmount nMNBlockReward;
int64_t nProposalEstablishmentTime;
int nStakeMinAge;
int nStakeMinDepth;
Expand Down
3 changes: 2 additions & 1 deletion src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,8 @@ CAmount GetBlockValue(int nHeight)

int64_t GetMasternodePayment()
{
return 3 * COIN;
// Future: refactor function callers to use this line directly.
return Params().GetConsensus().nMNBlockReward;
}

bool IsInitialBlockDownload()
Expand Down

0 comments on commit 139596e

Please sign in to comment.