MAX_MONEY is used in various places to clamp transaction amounts. For example, a transaction can't pay an output more than MAX_MONEY coins (as that would just be impossible, so any number over MAX_MONEY is invalid). This is just as odolvlobo says.
Yes, you're right, sorry. Judging the source code, it's only used to prevent another overflow incident. (just like in
block 74638). Although, you do have to change it if you fork Bitcoin Core, otherwise you won't be able to create an output spending more than 21 million coins.
To put it simply, Bitcoin nodes don't sum all the bitcoins and check if there are more than 21 million. (This is how a newbie would think of it)
I don't know if
MAX_MONEY is being used outside
main.cpp, but that's its only use in that file:
// Check for negative or overflow input values
if (txPrev.vout[prevout.n].nValue < 0)
return error("ConnectInputs() : txin.nValue negative");
if (txPrev.vout[prevout.n].nValue > MAX_MONEY)
return error("ConnectInputs() : txin.nValue too high");
if (nValueIn > MAX_MONEY)
return error("ConnectInputs() : txin total too high");
So I guess you could print more coin and used them outside of the mining rewards then... .Maybe print lot more specifically for Bitcoin price governance or price regulation. But you probably have to get the whole community agree to this, under the condition that the Bitcoin deflationary ideal won't be violated.
Changes in the code may occur to upgrade the software, but the consensus rules will remain the same. There isn't anything to be agreed, if you don't believe they should be 21M, you can leave Bitcoin. If the majority of the people that run a node, believe that Bitcoin should have more than 21M coins, they're free to change the block rewards. They'll have to comprehend, though, that they'll instantly stop being the majority.
That, also, answers to the next part of your post, which IMO isn't made to be taken seriously.