Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
Add check for 0 total balance in get_base_reward
Browse files Browse the repository at this point in the history
  • Loading branch information
NIC619 committed Mar 17, 2019
1 parent 839d7fb commit 2235a03
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions eth2/beacon/epoch_processing_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ def get_base_reward(
base_reward_quotient: int,
previous_total_balance: Gwei,
max_deposit_amount: Gwei) -> Gwei:
if previous_total_balance == 0:
return Gwei(0)
adjusted_quotient = (
integer_squareroot(previous_total_balance) // base_reward_quotient
)
Expand Down

0 comments on commit 2235a03

Please sign in to comment.