Skip to content

Commit

Permalink
compatible fix to support both old gesn.ipc endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
hackmod committed Apr 4, 2019
1 parent 5b49290 commit 8a9b529
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cmd/geth/config.go
Expand Up @@ -22,7 +22,9 @@ import (
"fmt"
"math/big"
"os"
"path/filepath"
"reflect"
"strings"
"unicode"

cli "gopkg.in/urfave/cli.v1"
Expand Down Expand Up @@ -104,6 +106,9 @@ func defaultNodeConfig() node.Config {
cfg.HTTPModules = append(cfg.HTTPModules, "eth", "shh")
cfg.WSModules = append(cfg.WSModules, "eth", "shh")
cfg.IPCPath = "geth.ipc"
if strings.HasPrefix(filepath.Base(os.Args[0]), "gesn") {
cfg.IPCPath = "gesn.ipc"
}
return cfg
}

Expand Down
8 changes: 7 additions & 1 deletion node/config.go
Expand Up @@ -241,6 +241,9 @@ func (c *Config) NodeName() string {
if name == "geth" || name == "geth-testnet" {
name = "Gesn"
}
if name == "gesn" || name == "gesn-testnet" {
name = "Gesn"
}
if c.UserIdent != "" {
name += "/" + c.UserIdent
}
Expand All @@ -260,6 +263,9 @@ func (c *Config) name() string {
}
return progname
}
if strings.HasPrefix(filepath.Base(os.Args[0]), "gesn") {
return "gesn"
}
return c.Name
}

Expand Down Expand Up @@ -302,7 +308,7 @@ func (c *Config) instanceDir() string {
return ""
}
oldpath := filepath.Join(c.DataDir, "gesn")
if common.FileExist(oldpath) {
if common.FileExist(oldpath) || strings.HasPrefix(filepath.Base(os.Args[0]), "gesn") {
return oldpath
}
return filepath.Join(c.DataDir, c.name())
Expand Down

0 comments on commit 8a9b529

Please sign in to comment.