I want to have an halving every year (210000/4 block or so) and I want to distribute 28028* COIN to the miners with a halving of 1.61
Also I pre-mine 100 Billions
Am I doing anything wrong?
Programmers, let me know your feedback
{
CAmount nSubsidy=0;
double halvings = nHeight / consensusParams.nSubsidyHalvingInterval; // no need to be an int with new algo
if(nHeight == 3) // block 3 is pre-mining
{
CAmount nSubsidy = 100000000000 * COIN; // premine 100 billions
halvings=1.0;
}else {
CAmount nSubsidy = 28028 * COIN;
int years = (int) nHeight/52560; // 210000/4
halvings = (years/1.618033988750);
}
if (halvings<=1.0) halvings=1.0;
nSubsidy = nSubsidy / halvings;
return nSubsidy;
}