Merge pull request #718 from ethereum/empty-base-reward
handle get_base_reward when no previous balance
This commit is contained in:
commit
be1cb4a850
|
@ -2169,6 +2169,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
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue