From b79f0cdf68a26666bbd2bac6e578bf59627ff76c Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Sat, 16 Feb 2019 15:09:14 +1100 Subject: [PATCH] Fix bug with reward quotient in epoch processing --- eth2/state_processing/src/epoch_processable.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eth2/state_processing/src/epoch_processable.rs b/eth2/state_processing/src/epoch_processable.rs index a930cd750..11b2b224d 100644 --- a/eth2/state_processing/src/epoch_processable.rs +++ b/eth2/state_processing/src/epoch_processable.rs @@ -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); }