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 division by zero edge case in reward calc #1876

Merged
merged 1 commit into from Sep 28, 2020

Conversation

JaredCorduan
Copy link
Contributor

If the total stake is zero (which would only happen if the reserves held all the ada, ie 45B on mainnet), or if the active stake is zero (if, for instance, every stake key was deregistered), the reward calculation would attempt to divide by zero. But not after this PR!

Copy link
Contributor

@uroboros uroboros left a comment

Choose a reason for hiding this comment

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

LGTM!

@nc6 nc6 merged commit f824efa into master Sep 28, 2020
@iohk-bors iohk-bors bot deleted the jc/fix-total-and-active-stake-denoms branch September 28, 2020 02:40
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