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

cryptocode
Copy link
Contributor

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 February 17, 2019 13:14
@wezrule
Copy link
Contributor

wezrule 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
Copy link
Contributor Author

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
@cryptocode cryptocode deleted the fix/uninitialized-peer-info branch February 18, 2019 09:24
@cryptocode cryptocode modified the milestones: V19.0, V18.0 Feb 18, 2019
argakiig pushed a commit that referenced this pull request Feb 18, 2019
* Initialize peer_information members

* Initialize probable_rep_account in-class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants