diff --git a/consensus/ethash/ethash.go b/consensus/ethash/ethash.go index 78892e1da8..a012d0a583 100644 --- a/consensus/ethash/ethash.go +++ b/consensus/ethash/ethash.go @@ -223,7 +223,7 @@ func (c *cache) generate(dir string, limit int, test bool) { size = 1024 } // If we don't store anything on disk, generate and return. - if dir == "" { + if dir == "" || limit <= 0 { c.cache = make([]uint32, size/4) generateCache(c.cache, c.epoch, seed) return @@ -305,7 +305,7 @@ func (d *dataset) generate(dir string, limit int, test bool) { dsize = 32 * 1024 } // If we don't store anything on disk, generate and return - if dir == "" { + if dir == "" || limit <= 0 { cache := make([]uint32, csize/4) generateCache(cache, d.epoch, seed)