I did 20-minulte-research on source code and find something. I'm not so familiar with C-programming and unfortunately English is not my native tongue, so be patient with reading that.
What i'm find on Bitcoin forum:
https://bitcointalksearch.org/topic/mainh-maxmoney-21000000-331069He clearly doesn't understand the code, then. MAX_MONEY is only used as a sanity check to prevent "impossible" transactions and integer overflows (any transaction sending more than MAX_MONEY is invalid, regardless of all other factors). The actual limit is enforced in this function in main.cpp:
int64 static GetBlockValue(int nHeight, int64 nFees)
{
int64 nSubsidy = 50 * COIN;
// Subsidy is cut in half every 210000 blocks, which will occur approximately every 4 years
nSubsidy >>= (nHeight / 210000);
return nSubsidy + nFees;
}
The result of this code is the first 210,000 blocks are worth
BTC50 each, the next 210,000 blocks are worth
BTC25 each, and so on (any block created with a greater value (eg, by modified or faulty mining software) will be rejected as invalid by all other nodes). This is a convergent infinite series with a limit of
BTC21,000,000. However, due to rounding errors, the series is actually finite, and reaches a limit of
BTC20,999,999.97690000 after 6,930,000 blocks.
So, as he said, the MAX_COINS does not define maximum of total coin supply directly. There is no direct constant in the sources that define this. MAX_COINS uses in some boundary checks, for example, max transaction amount.
Max coin supply amount defines implicitly in the infinite series, driven in the GetBlockValue() function.
The COIN constant is defined in the util.h header:
static const int64 COIN = 100000000;
As all amount in the coin system defines in integer values, real amounts are stored in satoshis. (1 satoshi = 1e-8 coin base, 1 satoshi = 1/100mil = 0.00000001 TIPS).
As i said above, MAX_MONEY define the maximum amount of transaction (and may be something more). At this moment it looks like:
static const int64 MAX_MONEY = 2500000000 * COIN; // FedoraCoin: maximum of 100B coins (given some randomness), max transaction 500,000,000 for now
It is 2.5 bil coins now. I think that developer comment of 500 mil max transaction is wrong, he is mistaked at this place.
What about real total coin supply ?
int64 static GetBlockValue(int nHeight, int64 nFees, uint256 prevHash)
{
int64 nSubsidy = 10000 * OLDCOIN;
std::string cseed_str = prevHash.ToString().substr(7,7);
const char* cseed = cseed_str.c_str();
long seed = hex2long(cseed);
int rand = generateMTRandom(seed, 999999);
int rand1 = 0;
int rand2 = 0;
int rand3 = 0;
int rand4 = 0;
int rand5 = 0;
if(nHeight < 100000)
{
nSubsidy = (1 + rand) * OLDCOIN;
}
else if(nHeight < 200000)
{
cseed_str = prevHash.ToString().substr(7,7);
cseed = cseed_str.c_str();
seed = hex2long(cseed);
rand1 = generateMTRandom(seed, 499999);
nSubsidy = (1 + rand1) * OLDCOIN;
}
else if(nHeight < 300000)
{
cseed_str = prevHash.ToString().substr(6,7);
cseed = cseed_str.c_str();
seed = hex2long(cseed);
rand2 = generateMTRandom(seed, 249999);
nSubsidy = (1 + rand2) * OLDCOIN;
}
else if(nHeight < 400000)
{
cseed_str = prevHash.ToString().substr(7,7);
cseed = cseed_str.c_str();
seed = hex2long(cseed);
rand3 = generateMTRandom(seed, 124999);
nSubsidy = (1 + rand3) * OLDCOIN;
}
else if(nHeight < 500000)
{
cseed_str = prevHash.ToString().substr(7,7);
cseed = cseed_str.c_str();
seed = hex2long(cseed);
rand4 = generateMTRandom(seed, 62499);
nSubsidy = (1 + rand4) * OLDCOIN;
}
else if(nHeight < 600000)
{
cseed_str = prevHash.ToString().substr(6,7);
cseed = cseed_str.c_str();
seed = hex2long(cseed);
rand5 = generateMTRandom(seed, 31249);
nSubsidy = (1 + rand5) * OLDCOIN;
}
return nSubsidy + nFees;
}
Compared with the Dogecoin source, there is only new OLDCOIN instead of COIN value. OLDCOIN also in util.h is 500m, the Dogecoin COIN is 100m. COIN as i said above is satoshi-multiplier. I think it must stays as 100m in new coin. As we see, the real block rewards are 5x more than in DogeCoin. This explains the explosive emission in the first couple of coin days. A real total coin supply defines as infinite series and looks like it must be 500 bil really.
So, I see at this moment, Fedora coin technically is a Dogecoin, but all block rewards are 5x of doge.
What did you guys thinking about that ?