mirror of
https://github.com/jwinterm/myriadcoin.git
synced 2026-11-16 09:33:57 +01:00
Phase 2 reward
This commit is contained in:
@@ -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)
|
||||
|
||||
+10
-9
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user