<p>main.cpp:</p>

<pre><code>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 &gt;&gt;= (nHeight / Params().SubsidyHalvingInterval());

    return nSubsidy + nFees;
}
</code></pre>

<p>miner.cpp (within CreateNewBlock):</p>

<pre><code>pblock-&gt;vtx[0].vout[0].nValue = GetBlockValue(pindexPrev-&gt;nHeight+1, nFees);
</code></pre>

CC BY-SA 3.0
2014-04-28T11:39:11.917Z
2014-04-28T11:39:11.917Z
Joe Amenta
<p>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.</p>

<development><block><altcoin>
In what line of what file does the block reward depend on?
Triyoga Aria Wardhana
# In what line of what file does the block reward depend on?

(Asked by: username_0 on 2014-04-24)

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.

**Tags:** development, block, altcoin


---

## 1 answers

### Answer by username_1 on 2014-04-28. Score: 2 | Accepted answer

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);


---

