good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 65e1095c authored by Péter Szilágyi's avatar Péter Szilágyi
Browse files

consensus/ethash: close mmap before rename, windows limitation

parent ee05cc4a
No related branches found
No related tags found
Loading
......@@ -130,13 +130,16 @@ func memoryMapAndGenerate(path string, size uint64, generator func(buffer []uint
data := buffer[len(dumpMagic):]
generator(data)
if err := mem.Flush(); err != nil {
mem.Unmap()
dump.Close()
if err := mem.Unmap(); err != nil {
return nil, nil, nil, err
}
if err := dump.Close(); err != nil {
return nil, nil, nil, err
}
if err := os.Rename(temp, path); err != nil {
return nil, nil, nil, err
}
os.Rename(temp, path)
return dump, mem, data, nil
return memoryMap(path)
}
// cache wraps an ethash cache with some metadata to allow easier concurrent use.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment