Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work multiplier format and RPC work_validate fix for lower difficulties #1984

merged 7 commits into from May 15, 2019


2 participants
Copy link

commented May 15, 2019

Reported by @cryptocode , thanks.

{"action": "work_validate", "work":"4f4a0cfb4a25dc78", "hash":"0000000000000000000000000000000000000000000000000000000000000002", "difficulty":"000000000000001"}


"valid": "0",
"difficulty": "82ddbf2c0bd1ae98",
"multiplier": "3.0484946624529728e-08"


"valid": "1",
"difficulty": "82ddbf2c0bd1ae98",
"multiplier": "0.000000030484947"

Note valid 1 (c6d7f18) and the format fix. Precision is 15 decimal cases, even with higher difficulties.

@cryptocode cryptocode self-requested a review May 15, 2019

@cryptocode cryptocode added the bug label May 15, 2019

@cryptocode cryptocode added this to the V19.0 milestone May 15, 2019

Show resolved Hide resolved nano/node/json_handler.cpp Outdated

@cryptocode cryptocode added this to RC 3 (TBD) in V19 May 15, 2019

@cryptocode cryptocode merged commit e822707 into nanocurrency:master May 15, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed

argakiig added a commit to argakiig/raiblocks that referenced this pull request May 22, 2019

Work multiplier format and RPC work_validate fix for lower difficulti…
…es (nanocurrency#1984)

* Format multipliers using fixed and max precision rather than scientific

* Fix RPC work_validate returning invalid for difficulty lower than threshold

* Move nano::to/from_string_hex to lib/numbers.hpp

* Parameter can be const in nano::to_string_hex

* Extract nano::to_string method for converting double with fixed and custom precision. Use std streams rather than boost

* Fix intermitent failure of rpc.work_generate test

* Prevent crash in debug if given difficulty is 0

@guilhermelawless guilhermelawless deleted the guilhermelawless:no-scientific branch Jun 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.