Open neurofluxation opened 5 years ago
Bump. I have found out nothing more, this just seem to "happen" after running for a while...?
This is due to the weirdness in JavaScript's float processing. Whatever you do, do NOT use floats in a blockchain / cryptocurrency, it's a road to doom haha. Instead, use full integers as "Satoshis". And on the interface of the wallet / terminal, display those divided by 100,000,000 (If you're wanting 8 decimal places, like Bitcoin). And also make sure to round to the nearest integer during operations like multiplication/division, juuust to ensure JS doesn't pull any tricks.
If you want a package designed for handling these kind of numbers, try "bignum" packages.
Good Kitty - Thank you, solved!
BigInt is a thing now so native JS should work.
Hey there (yet again),
So I have been getting an invalid block balance when mining an empty block all of a sudden and I can't seem to work out why. Doesn't matter if I restart the blockchain or not. Seems to happen randomly.
This is the exact error: Invalid block balance: inputs sum '46.04300000000003', outputs sum '46.04300000000004
Obviously the amounts will differ, it's been bugging me for a while now.
Thanks!
Edit: Here's my config... https://i.imgur.com/FA0TWEt.png