It is only how the coins are generated where I am still trying to understand.
This is not a secret project to talk through PM, if we have successfully cloned the coin and premined them, this topic might serve someone who is looking through the same in future. I don't have much idea on how Peercoin works, but I have read that they do share the same code as bitcoin with minor changes.
I have cloned bitcoin once, and with the older version of bitcoin-qt client the coin generation probably takes place in the main.cpp code of the bitcoin. But with the newer versions coming into picture, this main.cpp of the older client has been split into net_processing.cpp and validation.cpp. If your compound coin code has main.cpp check for the
GetBlockSubsidy method in it. Otherwise they would be present in validation.cpp of the code. The code would look like
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
{
int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
// Force block reward to zero when right shift is undefined.
if (halvings >= 64)
return 0;
CAmount nSubsidy = 50 * COIN;
// Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
nSubsidy >>= halvings;
return nSubsidy;
}
We need to consider that there are totally 100,000,000 satoshis in one bitcoin. Hence at the start of the code, 50 is multiplied with this 100,000,000 satoshis which yields 50 bitcoins in total as the initial Subsidy. Once 210,000 blocks are mined the subsidy is cut in half since
nHeight is the total block height. When the 64 halvings are reached in total the code returns only 0. So after 64 halving period the miner receives only fees.
That is where I am having the issues is that it does not indicate anything being premined; thus, no coins being generated.
I went to check the code snippet and could not find it on the main.cpp file. I am sure there has been modifications done throughout the previous clone.
Mine is forked from Compound-Coin and there are modifications based on my coin.