Bitcoin Forum
May 06, 2024, 06:26:36 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Block rewards  (Read 40 times)
dafa_ce (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
August 11, 2021, 06:59:16 AM
 #1

Hi All

Just creating an altcoin based of bitcoin. Was just wondering the following:

- In amount.h if i cahnge the maxmoney (for sanity check)

static const CAmount COIN = 100000000;

/** No amount larger than this (in satoshi) is valid.
 *
 * Note that this constant is *not* the total money supply, which in Cerebralcoin
 * currently happens to be less than 21,000,000 CEB for various reasons, but
 * rather a sanity check. As this sanity check is used by consensus-critical
 * validation code, the exact value of the MAX_MONEY constant is consensus
 * critical; in unusual circumstances like a(nother) overflow bug that allowed
 * for the creation of coins out of thin air modification could lead to a fork.
 * */
static const CAmount MAX_MONEY = 63000000000 * COIN;

That would imply the max money would be 63000000000 * 100000000.. that wont overflow will it?

- Also in regards to GetBlockSubsidy

CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
{
    int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
    // Force block reward to zero when right shift is undefined.
    if (halvings >= 64)
        return 0;

    CAmount nSubsidy = 150000 * COIN;
   
    nSubsidy >>= halvings;
    return nSubsidy;
}

I've change the nsubsidy to the above. So it should the above maths be right?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!