Fix difficulty calc for short chains

This commit is contained in:
Ignotus Peverell 2018-03-22 16:38:42 +00:00
parent 054114027f
commit 9d366fe492
No known key found for this signature in database
GPG key ID: 99CD25F39F8F8211

View file

@ -262,7 +262,7 @@ where
// the 71-15=56 pre genesis blocks will have // the 71-15=56 pre genesis blocks will have
// intervals/difficulties I1..I15 I1..I15 I1..I15 I1..I11 // intervals/difficulties I1..I15 I1..I15 I1..I15 I1..I11
for _ in 0..block_count_difference { for _ in 0..block_count_difference {
last_ts = last_ts - live_intervals[interval_index].0; last_ts = last_ts.saturating_sub(live_intervals[interval_index].0);
let last_diff = &live_intervals[interval_index].1; let last_diff = &live_intervals[interval_index].1;
last_n.insert(0, Ok((last_ts, last_diff.clone()))); last_n.insert(0, Ok((last_ts, last_diff.clone())));
interval_index = match interval_index { interval_index = match interval_index {