From f80d9fed49088f3bb1bbb9d7223d438714d10100 Mon Sep 17 00:00:00 2001 From: Jianping Wu Date: Sat, 15 Dec 2018 21:22:25 -0800 Subject: [PATCH] Set the same halving schedule as bitcoin. Increased block reward to 500. --- src/chainparams.cpp | 6 +++--- src/test/main_tests.cpp | 2 +- src/validation.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 54b9b0812..e99b8e003 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -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"); diff --git a/src/test/main_tests.cpp b/src/test/main_tests.cpp index 77bbce670..48e98f49d 100644 --- a/src/test/main_tests.cpp +++ b/src/test/main_tests.cpp @@ -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); diff --git a/src/validation.cpp b/src/validation.cpp index f0ca721a6..5fb43602a 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -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 // 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")));