From eeb322ae649c4a1a32430cdddfffed70f509181e Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 18 Aug 2016 13:28:17 +0200 Subject: 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. --- node/api.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'node/api.go') 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, ",") { -- cgit v1.2.3 From b42a5b118f1aa7ac1235547c8594146978941401 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 16 Sep 2016 11:53:50 +0200 Subject: common, node: move datadir defaults into package node --- node/api.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'node/api.go') diff --git a/node/api.go b/node/api.go index 2942705d9..631e92c8e 100644 --- a/node/api.go +++ b/node/api.go @@ -84,7 +84,7 @@ func (api *PrivateAdminAPI) StartRPC(host *string, port *rpc.HexNumber, cors *st } if host == nil { - h := common.DefaultHTTPHost + h := DefaultHTTPHost if api.node.config.HTTPHost != "" { h = api.node.config.HTTPHost } @@ -133,7 +133,7 @@ func (api *PrivateAdminAPI) StartWS(host *string, port *rpc.HexNumber, allowedOr } if host == nil { - h := common.DefaultWSHost + h := DefaultWSHost if api.node.config.WSHost != "" { h = api.node.config.WSHost } -- cgit v1.2.3