mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd/geth: check for legacy testnet path in console command
This commit is contained in:
parent
36be1022d1
commit
4bba9f7cb3
1 changed files with 8 additions and 1 deletions
|
|
@ -124,7 +124,14 @@ func remoteConsole(ctx *cli.Context) error {
|
|||
}
|
||||
if path != "" {
|
||||
if ctx.GlobalBool(utils.LegacyTestnetFlag.Name) || ctx.GlobalBool(utils.RopstenFlag.Name) {
|
||||
path = filepath.Join(path, "testnet")
|
||||
// Maintain compatibility with older Geth configurations storing the
|
||||
// Ropsten database in `testnet` instead of `ropsten`.
|
||||
legacyPath := filepath.Join(path, "testnet")
|
||||
if _, err := os.Stat(legacyPath); !os.IsNotExist(err) {
|
||||
path = legacyPath
|
||||
} else {
|
||||
path = filepath.Join(path, "ropsten")
|
||||
}
|
||||
} else if ctx.GlobalBool(utils.RinkebyFlag.Name) {
|
||||
path = filepath.Join(path, "rinkeby")
|
||||
} else if ctx.GlobalBool(utils.GoerliFlag.Name) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue