Skip to content

Commit

Permalink
fix money supply for release
Browse files Browse the repository at this point in the history
  • Loading branch information
bitzeny committed Nov 7, 2014
1 parent 15a5147 commit 0c63689
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CMainParams : public CChainParams {
nDefaultPort = 9253;
nRPCPort = 9252;
bnProofOfWorkLimit = CBigNum(~uint256(0) >> 14);
nSubsidyHalvingInterval = 3000;
nSubsidyHalvingInterval = 500000;

// Build the genesis block. Note that the output of the genesis coinbase cannot
// be spent as it did not originally exist in the database.
Expand All @@ -52,7 +52,7 @@ class CMainParams : public CChainParams {
txNew.vin.resize(1);
txNew.vout.resize(1);
txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
txNew.vout[0].nValue = 500 * COIN;
txNew.vout[0].nValue = 250 * COIN;
txNew.vout[0].scriptPubKey = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;
genesis.vtx.push_back(txNew);
genesis.hashPrevBlock = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class CTransaction;

/** No amount larger than this (in satoshi) is valid */
static const int64_t MAX_MONEY = 3000000 * COIN;
static const int64_t MAX_MONEY = 250000000 * COIN;
inline bool MoneyRange(int64_t nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }

/** An outpoint - a combination of a transaction hash and an index n into its vout */
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ void static PruneOrphanBlocks()

int64_t GetBlockValue(int nHeight, int64_t nFees)
{
int64_t nSubsidy = 500 * COIN;
int64_t nSubsidy = 250 * COIN;
int halvings = nHeight / Params().SubsidyHalvingInterval();

// Force block reward to zero when right shift is undefined.
Expand Down
4 changes: 2 additions & 2 deletions src/test/main_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ BOOST_AUTO_TEST_CASE(subsidy_limit_test)
uint64_t nSum = 0;
for (int nHeight = 0; nHeight < 14000000; nHeight += 1000) {
uint64_t nSubsidy = GetBlockValue(nHeight, 0);
BOOST_CHECK(nSubsidy <= 500 * COIN);
BOOST_CHECK(nSubsidy <= 250 * COIN);
nSum += nSubsidy * 1000;
BOOST_CHECK(MoneyRange(nSum));
}
printf("nSum %llu MAX_MONEY %llu\n", nSum, nSum / COIN + 1);
BOOST_CHECK(nSum == 299999999955000ULL);
BOOST_CHECK(nSum == 24999999902000000ULL);
}

BOOST_AUTO_TEST_SUITE_END()

0 comments on commit 0c63689

Please sign in to comment.