Skip to content

Commit

Permalink
Merge pull request #4227 from zhangsoledad/zhangsoledad/fix-dummy-blo…
Browse files Browse the repository at this point in the history
…ck-reward

fix: dummy block reward
  • Loading branch information
zhangsoledad authored Nov 13, 2023
2 parents 1bebc3d + ce66490 commit d07b58a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions spec/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d07b58a

Please sign in to comment.