Skip to content

Commit e3dfd55

Browse files
authored
Merge pull request ethereum#14598 from konradkonrad/fix_makedag
consensus/ethash, cmd/geth: Fix `makedag` epoch
2 parents 80f7c6c + 2fefe4b commit e3dfd55

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

consensus/ethash/ethash.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,14 +308,14 @@ func (d *dataset) release() {
308308

309309
// MakeCache generates a new ethash cache and optionally stores it to disk.
310310
func MakeCache(block uint64, dir string) {
311-
c := cache{epoch: block/epochLength + 1}
311+
c := cache{epoch: block / epochLength}
312312
c.generate(dir, math.MaxInt32, false)
313313
c.release()
314314
}
315315

316316
// MakeDataset generates a new ethash dataset and optionally stores it to disk.
317317
func MakeDataset(block uint64, dir string) {
318-
d := dataset{epoch: block/epochLength + 1}
318+
d := dataset{epoch: block / epochLength}
319319
d.generate(dir, math.MaxInt32, false)
320320
d.release()
321321
}

0 commit comments

Comments
 (0)