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

Fix jumping peer stake total #2405

merged 1 commit into from Nov 15, 2019


Copy link

wezrule commented Nov 15, 2019

The issue was tracked down to the hash of an endpoint inside a boost::multi_index_container being different depending on where it was called. Unfortunately it seemed that it was only easily reproducible on a release configuration on Windows which made debugging a bit harder. The culprit was the ip_address_hash_raw function which assumes that the same random constants variable is used each time. This is the case in the same translation unit, but because it is defined inside an unnamed namespace in a header, each translation unit which includes this (common.hpp) gets its own copy and hence each initialises its own static random_constants. Why it is a problem for some compilers/configurations and not others probably boils down to some compiler specific optimisations.

@wezrule wezrule added the bug label Nov 15, 2019
@wezrule wezrule self-assigned this Nov 15, 2019
@wezrule wezrule changed the base branch from master to develop Nov 15, 2019
@wezrule wezrule merged commit 809deaa into nanocurrency:develop Nov 15, 2019
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
continuous-integration/travis-ci/pr The Travis CI build passed
@wezrule wezrule deleted the wezrule:random_constants_static branch Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
5 participants
You can’t perform that action at this time.