Skip to content

Commit

Permalink
Merge branch 'fix_diff' into v1.0-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
peilun-conflux committed Nov 25, 2021
2 parents 28f226e + 80b7449 commit 9de2cc9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/pow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,11 @@ where
// d_{t+1}=0.8*d_t+0.2*d'
// where d_t is the difficulty of the current period, and d' is the
// expected difficulty to reach the ideal block_generation_period.
let mut target_diff = cur_difficulty / 5 * 4 + expected_diff / 5;
let mut target_diff = if epoch < pow_config.cip81_height {
expected_diff
} else {
cur_difficulty / 5 * 4 + expected_diff / 5
};

let (lower, upper) = pow_config.get_adjustment_bound(cur_difficulty);
if target_diff > upper {
Expand Down

0 comments on commit 9de2cc9

Please sign in to comment.