In what line of what file does the block reward depend on?

1

I want to make an altcoin and since I am new, I wanted to know what sets the reward of a block after being mined.

Triyoga Aria Wardhana

Posted 2014-04-24T04:50:28.700

Reputation: 23

Answers

2

main.cpp:

int64_t GetBlockValue(int nHeight, int64_t nFees)
{
    int64_t nSubsidy = 50 * COIN;

    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= (nHeight / Params().SubsidyHalvingInterval());

    return nSubsidy + nFees;
}

miner.cpp (within CreateNewBlock):

pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees);

Joe Amenta

Posted 2014-04-24T04:50:28.700

Reputation: 381