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 zero voting power #3220

Closed
wants to merge 2 commits into from
Closed

fix zero voting power #3220

wants to merge 2 commits into from

Conversation

mvandeberg
Copy link
Contributor

Local PR for #3218

economicstudio and others added 2 commits January 6, 2019 21:41
Currently, a.voting_power of users who haven't voted for more than 5 days but had some financial transaction (e.g., claim reward) is set to 0, which no longer represents the voting power at the a.last_vote_time.

This fix returns the previous a.voting power when this reset happens (unless current_mana is 0, case 2 below).

This fix is safe cause vp_t1 = 0 can occur only in the following two cases:

1) 5 days passed
current voting power (calculated from a.voting_power and a.last_vote_time) will be 100% either way. But this fix is more informative, since it returns the last voting power.

2) vp_t2u = 0
L2085 return 0 (same as before)
@economicstudio
Copy link
Contributor

@mvandeberg Thank you for your quick response. But why the check has failed? I don't see any problem and I can't see the log. Is there any way, that I can do that check locally? I made some contributions to busy.org and it provides some checking procedure before commit, which is very convenient. I'd like to know if there is such for steem. Thanks!

@mvandeberg
Copy link
Contributor Author

mvandeberg commented Jan 7, 2019

From our CI server:

[Build tests] /usr/local/src/steem/libraries/plugins/apis/condenser_api/condenser_api.cpp: In member function ‘uint16_t steem::plugins::condenser_api::api_account_object::_compute_voting_power(const steem::plugins::database_api::api_account_object&)’:
[Build tests] /usr/local/src/steem/libraries/plugins/apis/condenser_api/condenser_api.cpp:2085:8: error: ‘vt_t2u’ was not declared in this scope
[Build tests] if( vt_t2u == 0 )
[Build tests] ^
[Build tests] /usr/local/src/steem/libraries/plugins/apis/condenser_api/condenser_api.cpp:2095:29: error: ‘const struct steem::plugins::database_api::api_account_object’ has no member named ‘voting_power’
[Build tests] return vp_t1 ? vp_t1 : a.voting_power;

Just looks like build errors...

You can replicate our CI system via a Docker build on your local machine.

@economicstudio
Copy link
Contributor

@mvandeberg Thanks! I'll check it out and resubmit.

@economicstudio
Copy link
Contributor

economicstudio commented Jan 8, 2019

@mvandeberg Is there a way to add commit to previous pull request? I tried, but I couldn't, so I made a new PR: #3221

Built and steemd was loaded well on my machine (MacOS). You can close this one and merge #3221 Thanks.

Copy link
Contributor

@sgerbino sgerbino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR fails CI due to a typo.
Development has continued on #3221.

@sgerbino sgerbino closed this May 1, 2019
@sgerbino sgerbino mentioned this pull request May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants