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

Initialize peer_information members #1738

Merged

Conversation

Projects
2 participants
@cryptocode
Copy link
Collaborator

commented Feb 17, 2019

rep_weight / probable_rep_account had random values.

@cryptocode cryptocode added the bug label Feb 17, 2019

@cryptocode cryptocode added this to the V19.0 milestone Feb 17, 2019

@cryptocode cryptocode self-assigned this Feb 17, 2019

@cryptocode cryptocode requested a review from wezrule Feb 17, 2019

@wezrule

This comment has been minimized.

Copy link
Collaborator

commented Feb 17, 2019

Are you sure rep_weight has a garbage value? It should be initialized here:

nano::amount rep_weight{ 0 };

I used in-class member initializers here as there are multiple constructors so saves some duplication in the source file (as well as reducing line count).

@cryptocode

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 17, 2019

I'll move probable_rep_account to in-class since rep_weight is done there (which I assumed had the same issue, didn't catch that some initialization was done in ctor and some in-class now...)

@cryptocode cryptocode merged commit 13f5ab9 into nanocurrency:master Feb 18, 2019

2 checks passed

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

@cryptocode cryptocode deleted the cryptocode:fix/uninitialized-peer-info branch Feb 18, 2019

@cryptocode cryptocode modified the milestones: V19.0, V18.0 Feb 18, 2019

@cryptocode cryptocode added this to During RC in V18 Feb 18, 2019

argakiig added a commit that referenced this pull request Feb 18, 2019

Initialize peer_information members (#1738)
* Initialize peer_information members

* Initialize probable_rep_account in-class

@zhyatt zhyatt moved this from RC2 to RC3 in V18 Feb 18, 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.