Skip to content

Commit

Permalink
Merge pull request ethereum#202 from etclabscore/feat/home-func
Browse files Browse the repository at this point in the history
utils: refactor to use HomeDir fn
  • Loading branch information
ziogaschr authored Dec 7, 2020
2 parents 6da9943 + 1d2e9b4 commit ace8189
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"io/ioutil"
"math/big"
"os"
"os/user"
"path/filepath"
"runtime"
"strconv"
Expand Down Expand Up @@ -1449,12 +1448,7 @@ func setEthashDatasetDir(ctx *cli.Context, cfg *eth.Config) {

case (ctx.GlobalBool(ClassicFlag.Name) || ctx.GlobalBool(MordorFlag.Name)) && cfg.Ethash.DatasetDir == eth.DefaultConfig.Ethash.DatasetDir:
// ECIP-1099 is set, use etchash dir for DAGs instead
home := os.Getenv("HOME")
if home == "" {
if user, err := user.Current(); err == nil {
home = user.HomeDir
}
}
home := HomeDir()
if runtime.GOOS == "darwin" {
cfg.Ethash.DatasetDir = filepath.Join(home, "Library", "Etchash")
} else if runtime.GOOS == "windows" {
Expand Down

0 comments on commit ace8189

Please sign in to comment.