<p>First of all, changing <code>MAX_MONEY</code> won't change the total money supply.  See <a href="https://bitcoin.stackexchange.com/questions/36612/why-doesnt-changing-max-money-change-the-maximum-number-of-coins">Why doesn&#39;t changing MAX_MONEY change the maximum number of coins?</a>  You will instead have to specify a new initial block reward and halving interval.</p>

<p>There isn't a command line option to display the total number of coins to be created.  But there is <a href="https://github.com/bitcoin/bitcoin/blob/fb17faefb8a314b8644dea3bd063faa1cbd7ae47/src/test/main_tests.cpp#L48" rel="nofollow noreferrer">a unit test</a> in the source code, called <code>subsidy_limit_test</code> that computes this value and compares it with the correct number for Bitcoin.  You could adapt this code to do the computation and print out the result, and then change the test so that your code will pass.</p>

CC BY-SA 3.0
2018-04-11T16:22:29.137Z
many thanks to share your time and knowledge
chico lima
CC BY-SA 3.0
2018-04-11T14:06:50.063Z
2018-04-11T14:06:50.063Z
Nate Eldredge
<p>No, there is no way to display the value of this constant. However, I am not sure that this constant is really doing what you want to do, so let me explain its meaning.</p>

<p>The constant MAX_MONEY is the maximum amount that can appear in an <strong>individual</strong> bitcoin transaction, for instance in tx_verify.cpp in CheckTransaction. Here, actually two checks are done:</p>

<ol>
<li>The amount in each transaction output is checked against this value</li>
<li>The total across all transaction outputs is checked</li>
</ol>

<p>So you could theoretically check that your new value is used after a recompile by submitting a transaction violating these constraints and wait for the error message.</p>

<p>However, what you actually want to do (if I read your question correctly) is to increase the <strong>total amount of bitcoin that can be mined</strong>. This number is not directly hardcoded, but the limit results out of the fact that every 210000 blocks, the subsidy, i.e. the amount of BTC that a miner earns in addition to the transaction fees for mining a block, is halved. This is done in GetBlockSubsidy in validation.cpp, using the parameter nSubsidyHalvingInterval in chainparams.cpp. Thus if you want to change that value (destroying consensus), you would have to make changes at these locations in the source code.</p>

CC BY-SA 3.0
2018-04-11T14:06:38.687Z
2018-04-11T14:06:38.687Z
christianb93
<p>it is any command line to check the ammout of coins willl be create after build the wallet?</p>

<p>i just cloned bitcoin and changed the ammount of coins to be 10 million</p>

<pre><code>MAX_MONEY = 10000000
</code></pre>

<p>so i would like to know if it is any command to check this value I inserted.</p>

<p>i know i can check
the amount in circulation using the RPC call <code>gettxoutsetinfo</code></p>

<bitcoin-core><altcoin><bitcoin-core-development>
it is any command line to check the ammout of coins willl be create after build the wallet?
chico lima
# it is any command line to check the ammout of coins willl be create after build the wallet?

(Asked by: username_0 on 2018-04-11)

it is any command line to check the ammout of coins willl be create after build the wallet?

i just cloned bitcoin and changed the ammount of coins to be 10 million

```
MAX_MONEY = 10000000

```

so i would like to know if it is any command to check this value I inserted.

i know i can check
the amount in circulation using the RPC call `gettxoutsetinfo`

**Tags:** bitcoin-core, altcoin, bitcoin-core-development


---

## 2 answers

### Answer by username_1 on 2018-04-11. Score: 0 | Accepted answer

First of all, changing `MAX_MONEY` won't change the total money supply. See [Why doesn't changing MAX\_MONEY change the maximum number of coins?](https://bitcoin.stackexchange.com/questions/36612/why-doesnt-changing-max-money-change-the-maximum-number-of-coins) You will instead have to specify a new initial block reward and halving interval.

There isn't a command line option to display the total number of coins to be created. But there is [a unit test](https://github.com/bitcoin/bitcoin/blob/fb17faefb8a314b8644dea3bd063faa1cbd7ae47/src/test/main_tests.cpp#L48) in the source code, called `subsidy_limit_test` that computes this value and compares it with the correct number for Bitcoin. You could adapt this code to do the computation and print out the result, and then change the test so that your code will pass.

> **Comments:**
> **username_0**: many thanks to share your time and knowledge  

---

### Answer by username_2 on 2018-04-11. Score: 1

No, there is no way to display the value of this constant. However, I am not sure that this constant is really doing what you want to do, so let me explain its meaning.

The constant MAX\_MONEY is the maximum amount that can appear in an **individual** bitcoin transaction, for instance in tx\_verify.cpp in CheckTransaction. Here, actually two checks are done:

1. The amount in each transaction output is checked against this value
2. The total across all transaction outputs is checked

So you could theoretically check that your new value is used after a recompile by submitting a transaction violating these constraints and wait for the error message.

However, what you actually want to do (if I read your question correctly) is to increase the **total amount of bitcoin that can be mined**. This number is not directly hardcoded, but the limit results out of the fact that every 210000 blocks, the subsidy, i.e. the amount of BTC that a miner earns in addition to the transaction fees for mining a block, is halved. This is done in GetBlockSubsidy in validation.cpp, using the parameter nSubsidyHalvingInterval in chainparams.cpp. Thus if you want to change that value (destroying consensus), you would have to make changes at these locations in the source code.


---

