We need new fix I think.
I don't get how block size can be 0.01 with this code?
{
if (nHeight <= 315000) nSubsidy = (310000 - ((nHeight - 310000) * 0.01)) * COIN;
if (nHeight > 315000) nSubsidy = (3100 - ((nHeight * 0.01) -310000)) - 300000; //Blockreward fixed decreasing 0.01 steps
if (nSubsidy <= 1000) nSubsidy = 1000; // Rest of blocks are 1000 coins. Then network working forever with stake blocks.
}
The code is wrong again.
I was the first one found the bug, PMed MCR and halibit, posted here the correct code, but no one wanted to hear me.
I will post here the correct code again. Let review it together, and hope this time you make it correct.
else if (nHeight >= 310000 && nHeight <= 315000) // 310,000 block rewards, decreasing 0.01 on every block
{
nSubsidy = (310000 - ((nHeight - 310000) * 0.01)) * COIN;
}
else if (nHeight <= 320000) // 0.01 block rewards (wrong logic as coin spec, but we need to keep it because it's already happened)
{
nSubsidy = (3100 - ((nHeight * 0.01) - 310000)) - 300000;
}
else
{
nSubsidy = (10000 - ((nHeight - 320000) * 0.01)) * COIN;
if (nSubsidy <= 1000 * COIN) nSubsidy = 1000 * COIN; // Rest of blocks are 1000 coins. Then network working forever with stake blocks.
}
Again, we need to pick another block number to apply this patch. Say it 320,000. New logic will be:
- Before block 310,000: Same
- Block 310,001 - 315,000: Block rewards from 310,000, reducing 0.01 each block (already happened)
- Block 315,001 - 320,000: Block rewards = 0.01 (happening - current block at the time of writing is 315143)
- Block 320,001+: Block rewards from 10,000, reducing 0.01 each block. And it will stop reducing at 1,000. (will happen at Block 1220001)
This new scheme we have 5000 blocks of 0.01 rewards, we can call it "calming down" period
![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif)
+1
That make sense.
hilibit push code without any test,poor coding,it's a horrible thing.
Never again.