oh ok, that makes perfect sense. i'm at a loss of how i would implement it in a coin with a minimum subsidy unless
static const int nMinReward= 1
//subsidyHalving Algo
nSubsidy>>(nHeight/1000000);
//stop subsidy from halving past a set number within nLastRewardBlock
if (nHeight < nLastRewardBlock && nSubsidy < nMinReward)
{
nSubsidy = nMinReward * COIN;
}
This should be sufficient:
static const int nMinReward= 1
//subsidyHalving Algo
nSubsidy>>(nHeight/1000000);
//stop subsidy from halving past a set number within nLastRewardBlock
if (nSubsidy < nMinReward)
{
nSubsidy = nMinReward * COIN;
}
no because if you don't acknowledge the last reward block then nMinReward will prevent it from dropping the subsidy to zero. thats why i included nLastRewardBlock in the scope
Not sure if you're trying to drop it to 0 or drop it to nMinReward. The above solution will halve until it gets to nMinReward and never get to zero.
I'm attempting to kill two birds with one stone. half the reward until it gets to 1, then when block 5million(the last reward block) subsidy returns to zero(thus creating the hardcap) with only tx fee's being the subsidy.