diff --git a/spec/src/consensus.rs b/spec/src/consensus.rs index 1627c483f6..ede01dd5c0 100644 --- a/spec/src/consensus.rs +++ b/spec/src/consensus.rs @@ -824,16 +824,15 @@ impl Consensus { epoch_duration_in_milliseconds, } => { if self.permanent_difficulty() { + let next_epoch_length = (self.epoch_duration_target() + MIN_BLOCK_INTERVAL + - 1) + / MIN_BLOCK_INTERVAL; let primary_epoch_reward = self.primary_epoch_reward_of_next_epoch(&epoch).as_u64(); let block_reward = - Capacity::shannons(primary_epoch_reward / epoch.length()); + Capacity::shannons(primary_epoch_reward / next_epoch_length); let remainder_reward = - Capacity::shannons(primary_epoch_reward % epoch.length()); - - let next_epoch_length = (self.epoch_duration_target() + MIN_BLOCK_INTERVAL - - 1) - / MIN_BLOCK_INTERVAL; + Capacity::shannons(primary_epoch_reward % next_epoch_length); let dummy_epoch_ext = epoch .clone()