Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix jumping peer stake total #2405

Merged
merged 1 commit into from
Nov 15, 2019

Conversation

wezrule
Copy link
Contributor

@wezrule 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 November 15, 2019 12:00
@wezrule wezrule merged commit 809deaa into nanocurrency:develop Nov 15, 2019
@wezrule wezrule deleted the random_constants_static branch November 15, 2019 14:21
Srayman pushed a commit to Srayman/nano-node that referenced this pull request Dec 12, 2019
@zhyatt zhyatt added this to the V21.0 milestone Jan 6, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants