all: use common.FileExist for checking file existence (#24748)

This commit is contained in:
s7v7nislands
2022-04-27 11:48:02 +02:00
committed by GitHub
parent c3a5054c27
commit 5a584c2133
5 changed files with 8 additions and 7 deletions
+1 -1
View File
@@ -1337,7 +1337,7 @@ func setDataDir(ctx *cli.Context, cfg *node.Config) {
// Maintain compatibility with older Geth configurations storing the
// Ropsten database in `testnet` instead of `ropsten`.
legacyPath := filepath.Join(node.DefaultDataDir(), "testnet")
if _, err := os.Stat(legacyPath); !os.IsNotExist(err) {
if common.FileExist(legacyPath) {
log.Warn("Using the deprecated `testnet` datadir. Future versions will store the Ropsten chain in `ropsten`.")
cfg.DataDir = legacyPath
} else {