Fix bug with reward quotient in epoch processing

This commit is contained in:
Paul Hauner 2019-02-16 15:09:14 +11:00
parent c5158e2974
commit b79f0cdf68
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6

View File

@ -359,7 +359,8 @@ impl EpochProcessable for BeaconState {
/*
* Rewards and Penalities
*/
let base_reward_quotient = previous_total_balance.integer_sqrt();
let base_reward_quotient =
previous_total_balance.integer_sqrt() / spec.base_reward_quotient;
if base_reward_quotient == 0 {
return Err(Error::BaseRewardQuotientIsZero);
}