Skip to content

Commit

Permalink
Fix parens in assert, and make moneysupply display in COINS
Browse files Browse the repository at this point in the history
  • Loading branch information
Earlz committed Aug 25, 2017
1 parent 095641f commit caeb532
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/rpc/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ UniValue getinfo(const JSONRPCRequest& request)
diff.push_back(Pair("proof-of-stake", GetDifficulty(GetLastBlockIndex(pindexBestHeader, true))));
obj.push_back(Pair("difficulty", diff));
obj.push_back(Pair("testnet", Params().NetworkIDString() == CBaseChainParams::TESTNET));
obj.push_back(Pair("moneysupply", pindexBestHeader->nMoneySupply));
obj.push_back(Pair("moneysupply", pindexBestHeader->nMoneySupply / COIN));
#ifdef ENABLE_WALLET
if (pwalletMain) {
obj.push_back(Pair("keypoololdest", pwalletMain->GetOldestKeyPoolTime()));
Expand Down
2 changes: 1 addition & 1 deletion src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2850,7 +2850,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
//only start checking this assert after block 5000 and only on testnet and mainnet, not regtest
if(pindex->nHeight > 5000 && !Params().GetConsensus().fPoSNoRetargeting) {
//sanity check to shut down the network in case an exploit happens that allows new coins to be minted
assert(pindex->nMoneySupply < 100000000 + ((pindex->nHeight - 5000) * 4) * COIN);
assert(pindex->nMoneySupply <= (uint64_t)(100000000 + ((pindex->nHeight - 5000) * 4)) * COIN);
}
// Write undo information to disk
if (pindex->GetUndoPos().IsNull() || !pindex->IsValid(BLOCK_VALID_SCRIPTS))
Expand Down

0 comments on commit caeb532

Please sign in to comment.