From 9902e2be94b9425062b00748f0eb4e70c4805078 Mon Sep 17 00:00:00 2001 From: myriadcoin Date: Sat, 11 Jul 2015 18:35:51 +0200 Subject: [PATCH] Phase 2 reward --- src/core.h | 2 ++ src/main.cpp | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/core.h b/src/core.h index 8804f032..1419880d 100644 --- a/src/core.h +++ b/src/core.h @@ -46,6 +46,8 @@ static const int AUXPOW_CHAIN_ID = 0x005A; static const int AUXPOW_START_MAINNET = 9999999; //TODO change me static const int AUXPOW_START_TESTNET = 1; +static const int Phase2Reward_Start = 9999999; + inline int GetAlgo(int nVersion) { switch (nVersion & BLOCK_VERSION_ALGO) diff --git a/src/main.cpp b/src/main.cpp index 0278fb1f..39f68ff9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1266,20 +1266,21 @@ const CBlockIndex* GetLastBlockIndexForAlgo(const CBlockIndex* pindex, int algo) static const int64_t nStartSubsidy = 1000 * COIN; static const int64_t nMinSubsidy = 1 * COIN; +static const int64_t nRewardPhase2StartSubsidy = 50 * COIN; int64_t GetBlockValue(int nHeight, int64_t nFees) { - int64_t nSubsidy = nStartSubsidy; + int64_t nSubsidy; - // Mining phase: Subsidy is cut in half every SubsidyHalvingInterval - nSubsidy >>= (nHeight / Params().SubsidyHalvingInterval()); - - // Inflation phase: Subsidy reaches minimum subsidy - // Network is rewarded for transaction processing with transaction fees and - // the inflationary subsidy - if (nSubsidy < nMinSubsidy) + if (nHeight < Phase2Reward_Start) { - nSubsidy = nMinSubsidy; + nSubsidy = nStartSubsidy; + nSubsidy >>= (nHeight / Params().SubsidyHalvingInterval()); + } + else + { + nSubsidy = nRewardPhase2StartSubsidy; + nSubsidy += (nHeight / Params().SubsidyHalvingInterval()); } return nSubsidy + nFees;