Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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.
vp_t2u = 0
L2085 return 0 (same as before)