Browse Source

Set the same halving schedule as bitcoin. Increased block reward to 500.

cn
Jianping Wu 6 years ago
parent
commit
f80d9fed49
  1. 6
      src/chainparams.cpp
  2. 2
      src/test/main_tests.cpp
  3. 6
      src/validation.cpp

6
src/chainparams.cpp

@ -66,10 +66,10 @@ class CMainParams : public CChainParams { @@ -66,10 +66,10 @@ class CMainParams : public CChainParams {
public:
CMainParams() {
strNetworkID = "main";
consensus.nSubsidyHalvingInterval = 13440000;
consensus.nSubsidyHalvingInterval = 1050000; // 210000 * 5
consensus.BIP16Height = 1;
consensus.BIP34Height = 200;
consensus.BIP34Hash = uint256S("0x581cc1e4153a2a367012d3678f0f83f7d62286d84e69ab860804acf3ff2f572b"); // Genesis
consensus.BIP34Height = 10;
//consensus.BIP34Hash = uint256S("0x581cc1e4153a2a367012d3678f0f83f7d62286d84e69ab860804acf3ff2f572b");
consensus.BIP65Height = 1;
consensus.BIP66Height = 1;
consensus.powLimit = uint256S("000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");

2
src/test/main_tests.cpp

@ -16,7 +16,7 @@ BOOST_FIXTURE_TEST_SUITE(main_tests, TestingSetup) @@ -16,7 +16,7 @@ BOOST_FIXTURE_TEST_SUITE(main_tests, TestingSetup)
static void TestBlockSubsidyHalvings(const Consensus::Params& consensusParams)
{
int maxHalvings = 64;
CAmount nInitialSubsidy = 50 * COIN;
CAmount nInitialSubsidy = 500 * COIN;
CAmount nPreviousSubsidy = nInitialSubsidy * 2; // for height == 0
BOOST_CHECK_EQUAL(nPreviousSubsidy, nInitialSubsidy * 2);

6
src/validation.cpp

@ -1192,8 +1192,8 @@ CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) @@ -1192,8 +1192,8 @@ CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
if (halvings >= 64)
return 0;
CAmount nSubsidy = 50 * COIN;
// Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
CAmount nSubsidy = 500 * COIN;
// Subsidy is cut in half every 210,000 * 5 blocks which will occur approximately every 4 years.
nSubsidy >>= halvings;
return nSubsidy;
}
@ -1910,7 +1910,7 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl @@ -1910,7 +1910,7 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl
// Now that the whole chain is irreversibly beyond that time it is applied to all blocks except the
// two in the chain that violate it. This prevents exploiting the issue against nodes during their
// initial block download.
bool fEnforceBIP30 = true;
bool fEnforceBIP30 = false;
//(!pindex->phashBlock) || // Enforce on CreateNewBlock invocations which don't have a hash.
// !((pindex->nHeight==91842 && pindex->GetBlockHash() == uint256S("0x00000000000a4d0a398161ffc163c503763b1f4360639393e0e4c8e300e0caec")) ||
// (pindex->nHeight==91880 && pindex->GetBlockHash() == uint256S("0x00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721")));

Loading…
Cancel
Save