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 #3218

Merged
merged 1 commit into from
Jan 7, 2019

Conversation

economicstudio
Copy link
Contributor

Fix #3217

Currently, a.voting_power of users who haven't voted for more than 5 days but had some financial transaction that affected effective vesting shares (e.g., claim reward, powerup, delegation) 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)

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)
@mvandeberg
Copy link
Contributor

Thank you for this work.

@mvandeberg mvandeberg merged commit fded6d7 into steemit:3218-PR Jan 7, 2019
@mvandeberg mvandeberg mentioned this pull request Jan 7, 2019
@economicstudio economicstudio deleted the fix-zero-voting-power branch January 8, 2019 01:06
@economicstudio economicstudio restored the fix-zero-voting-power branch January 8, 2019 01:14
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

2 participants