mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
eth: use LOCALAPPDATA env variable for the Ethash cache dir.
This commit is contained in:
parent
c5549ae256
commit
e7bb3468d3
1 changed files with 9 additions and 2 deletions
|
|
@ -67,8 +67,15 @@ func init() {
|
||||||
home = user.HomeDir
|
home = user.HomeDir
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "darwin" {
|
||||||
DefaultConfig.Ethash.DatasetDir = filepath.Join(home, "AppData", "Ethash")
|
DefaultConfig.Ethash.DatasetDir = filepath.Join(home, "Library", "Ethash")
|
||||||
|
} else if runtime.GOOS == "windows" {
|
||||||
|
localappdata := os.Getenv("LOCALAPPDATA")
|
||||||
|
if localappdata != "" {
|
||||||
|
DefaultConfig.Ethash.DatasetDir = filepath.Join(localappdata, "Ethash")
|
||||||
|
} else {
|
||||||
|
DefaultConfig.Ethash.DatasetDir = filepath.Join(home, "AppData", "Local", "Ethash")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
DefaultConfig.Ethash.DatasetDir = filepath.Join(home, ".ethash")
|
DefaultConfig.Ethash.DatasetDir = filepath.Join(home, ".ethash")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue