Post
Topic
Board Announcements (Altcoins)
Re: DNotes 2.0 - Bridging the Gap Between the Centralized and Decentralized World
by
flound1129
on 28/02/2018, 05:44:44 UTC
Found the issue -- it's a floating point bug in GetBlockValue()


Thanks flound1129! That is correct, some blocks like 2103797 reward 20.36265624 rather than (25*math.pow(0.95,4)) 20.36265625. The mystery remains, why your node rejects it and all the others seem fine with it.

It's not really a mystery, pow(0.95,4)*25 at https://github.com/DNotesCoin/DNotes/blob/master/src/main.cpp#L851-L853 evaluates to 20.362656249999997 on my system, which evaluates to False in the comparison at https://github.com/DNotesCoin/DNotes/blob/master/src/main.cpp#L1431 when the coinbase transaction vtx[0].getValueOut() == 20.36265625 and thus the block is considered invalid.