Skip to content

Commit

Permalink
fix: permanent difficulty mode reward
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangsoledad committed Jun 16, 2023
1 parent 37cca11 commit 926fa4c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -797,9 +797,18 @@ impl Consensus {
epoch_duration_in_milliseconds,
} => {
if self.permanent_difficulty() {
let primary_epoch_reward =
self.primary_epoch_reward_of_next_epoch(&epoch).as_u64();
let block_reward =
Capacity::shannons(primary_epoch_reward / epoch.length());
let remainder_reward =
Capacity::shannons(primary_epoch_reward % epoch.length());

let dummy_epoch_ext = epoch
.clone()
.into_builder()
.base_block_reward(block_reward)
.remainder_reward(remainder_reward)
.number(epoch.number() + 1)
.last_block_hash_in_previous_epoch(header.hash())
.start_number(header.number() + 1)
Expand Down

0 comments on commit 926fa4c

Please sign in to comment.