mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
consensus: don't use mmap if cache/dataset disk item is not allowed
This commit is contained in:
parent
f34a3a6805
commit
8c84443e77
1 changed files with 2 additions and 2 deletions
|
|
@ -223,7 +223,7 @@ func (c *cache) generate(dir string, limit int, test bool) {
|
||||||
size = 1024
|
size = 1024
|
||||||
}
|
}
|
||||||
// If we don't store anything on disk, generate and return.
|
// If we don't store anything on disk, generate and return.
|
||||||
if dir == "" {
|
if dir == "" || limit <= 0 {
|
||||||
c.cache = make([]uint32, size/4)
|
c.cache = make([]uint32, size/4)
|
||||||
generateCache(c.cache, c.epoch, seed)
|
generateCache(c.cache, c.epoch, seed)
|
||||||
return
|
return
|
||||||
|
|
@ -305,7 +305,7 @@ func (d *dataset) generate(dir string, limit int, test bool) {
|
||||||
dsize = 32 * 1024
|
dsize = 32 * 1024
|
||||||
}
|
}
|
||||||
// If we don't store anything on disk, generate and return
|
// If we don't store anything on disk, generate and return
|
||||||
if dir == "" {
|
if dir == "" || limit <= 0 {
|
||||||
cache := make([]uint32, csize/4)
|
cache := make([]uint32, csize/4)
|
||||||
generateCache(cache, d.epoch, seed)
|
generateCache(cache, d.epoch, seed)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue