aboutsummaryrefslogtreecommitdiffstats
path: root/node/api.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-08-18 19:28:17 +0800
committerFelix Lange <fjl@twurst.com>2016-09-16 21:24:31 +0800
commiteeb322ae649c4a1a32430cdddfffed70f509181e (patch)
tree35622201208afb98665743d9bcf88883058e772a /node/api.go
parent52ede09b172094f8fd85f8b10e7d0578059353fb (diff)
downloadgo-tangerine-eeb322ae649c4a1a32430cdddfffed70f509181e.tar
go-tangerine-eeb322ae649c4a1a32430cdddfffed70f509181e.tar.gz
go-tangerine-eeb322ae649c4a1a32430cdddfffed70f509181e.tar.bz2
go-tangerine-eeb322ae649c4a1a32430cdddfffed70f509181e.tar.lz
go-tangerine-eeb322ae649c4a1a32430cdddfffed70f509181e.tar.xz
go-tangerine-eeb322ae649c4a1a32430cdddfffed70f509181e.tar.zst
go-tangerine-eeb322ae649c4a1a32430cdddfffed70f509181e.zip
node: ensure datadir can be co-inhabited by different instances
This change ensures that nodes started with different Name but same DataDir values don't use the same nodekey and IPC socket.
Diffstat (limited to 'node/api.go')
-rw-r--r--node/api.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/node/api.go b/node/api.go
index 3523874ab..2942705d9 100644
--- a/node/api.go
+++ b/node/api.go
@@ -85,16 +85,16 @@ func (api *PrivateAdminAPI) StartRPC(host *string, port *rpc.HexNumber, cors *st
if host == nil {
h := common.DefaultHTTPHost
- if api.node.httpHost != "" {
- h = api.node.httpHost
+ if api.node.config.HTTPHost != "" {
+ h = api.node.config.HTTPHost
}
host = &h
}
if port == nil {
- port = rpc.NewHexNumber(api.node.httpPort)
+ port = rpc.NewHexNumber(api.node.config.HTTPPort)
}
if cors == nil {
- cors = &api.node.httpCors
+ cors = &api.node.config.HTTPCors
}
modules := api.node.httpWhitelist
@@ -134,19 +134,19 @@ func (api *PrivateAdminAPI) StartWS(host *string, port *rpc.HexNumber, allowedOr
if host == nil {
h := common.DefaultWSHost
- if api.node.wsHost != "" {
- h = api.node.wsHost
+ if api.node.config.WSHost != "" {
+ h = api.node.config.WSHost
}
host = &h
}
if port == nil {
- port = rpc.NewHexNumber(api.node.wsPort)
+ port = rpc.NewHexNumber(api.node.config.WSPort)
}
if allowedOrigins == nil {
- allowedOrigins = &api.node.wsOrigins
+ allowedOrigins = &api.node.config.WSOrigins
}
- modules := api.node.wsWhitelist
+ modules := api.node.config.WSModules
if apis != nil {
modules = nil
for _, m := range strings.Split(*apis, ",") {