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

Add missing CalculateOwnerRewards calls #1766

Merged
merged 5 commits into from
Mar 3, 2023
Merged

Add missing CalculateOwnerRewards calls #1766

merged 5 commits into from
Mar 3, 2023

Conversation

Bushstar
Copy link
Member

@Bushstar Bushstar commented Feb 16, 2023

Before SubBalance is called CalculateOwnerRewards should also be called to make sure the expected pool rewards are present. When AddBalance is called on a new address that might not have been seen by the network before CalculateOwnerRewards should be called to add that address to the account index.

This PR adds one missing call to CalculateOwnerRewards before SubBalance in the currently unused DFIP2201 smart contract. There are also a missing CalculateOwnerRewards calls for AddBalance on CWithdrawFromVaultMessage.

Now that we know that all other SubBalance calls that are currently in use have a corresponding CalculateOwnerRewards call we can remove the fork guards around other calls to this function that were restored in a more cautious manner.

Resolves:
#1763

@prasannavl
Copy link
Member

Should test the performance impact of this on the block, just to get an estimate before merging.

@prasannavl prasannavl added the v/next-network-upgrade Items ready or targeted for upcoming network upgrade release(s) label Feb 20, 2023
@Bushstar Bushstar mentioned this pull request Mar 1, 2023
@Bushstar Bushstar changed the title Add missing calc pool rewards Add missing CalculateOwnerRewards calls Mar 1, 2023
@prasannavl prasannavl added v/3.2.7 and removed v/next-network-upgrade Items ready or targeted for upcoming network upgrade release(s) labels Mar 3, 2023
@dcorral dcorral mentioned this pull request Mar 3, 2023
40 tasks
@prasannavl prasannavl merged commit b6914e8 into master Mar 3, 2023
@prasannavl prasannavl deleted the alt-fix branch March 3, 2023 16:30
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.

3 participants