Post
Topic
Board Announcements (Altcoins)
Re: [ANN] [PMC] Premine Coin | Rare | Mining Transaction Fee Proof of Concept
by
_CR_
on 01/03/2014, 01:04:16 UTC
Quote
I'm the random guy! Cheesy
The bug was in the GetBlockValue function. The problem was that the reward amount was determined by cutting by half the initial block reward every 250 blocks and the division was made by shifting the bits to the right. Doing this 64 times resetted the reward to the initial one. (I think using a normal division should solve the problem). I just watched the bitcoin source and it has the exact same problem. The difference is that bitcoin halves the reward every 210000 blocks instead of 250. So the reward will be resetted at block 13440000, when the number of the block divided by 210000 will be 64. I think we should tell them... but we have al lot of time to do it Smiley (we are at block 288372...)

But... but that makes no sense. If it's unsigned, then shifting to the right adds zero on the leftmost bit. Do it 64 times, and you end up with zeroes only.

EDIT: Aaah, int64_t. Nasty bug.
it happens also with int, unsigned , long (I just tested it)