Skip to content

Commit

Permalink
handle get_base_reward when no previous balance
Browse files Browse the repository at this point in the history
  • Loading branch information
djrtwo committed Mar 5, 2019
1 parent 0fdfbc4 commit 02e8e89
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions specs/core/0_beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -2171,6 +2171,9 @@ First, we define some additional helpers:

```python
def get_base_reward(state: BeaconState, index: ValidatorIndex) -> Gwei:
if get_previous_total_balance(state) == 0:
return 0

adjusted_quotient = integer_squareroot(get_previous_total_balance(state)) // BASE_REWARD_QUOTIENT
return get_effective_balance(state, index) // adjusted_quotient // 5
```
Expand Down

0 comments on commit 02e8e89

Please sign in to comment.