ruimarinho / bitcoin-core

A modern Bitcoin Core REST and RPC client.
480 stars 188 forks source link

getBlockchainInfo verificationprogress rounding issue #35

Closed shkschneider closed 6 years ago

shkschneider commented 6 years ago

bitcoin-cli returns me "verificationprogress": 1 but bitcoin-core returns me 0.9999941262782213

Since this is the return of the library I have no way to fix that rounding issue. I would expect 1 to be returned. (I know this is a common javascript problem.) Generally speaking, I would expect this library to delive 8 decimals number (8 decimals for satoshis). Maybe return numbers as strings and let the client interpret it like he wants it to (many libraries available).

ruimarinho commented 6 years ago

Indeed. Thanks for reporting this issue.

pedrobranco commented 6 years ago

Will submit a PR for this. Thanks for reporting this issue @shkschneider.

ruimarinho commented 6 years ago

Fixed in https://github.com/ruimarinho/bitcoin-core/commit/c035b34aefa65164857f521a75f356e65448b9e6. Thanks!