aboutsummaryrefslogtreecommitdiffstats
path: root/node
diff options
context:
space:
mode:
authorWei-Ning Huang <w@cobinhood.com>2018-10-15 12:16:18 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:49 +0800
commit031fe42b08bb576b250a81e1e3885f15910551c5 (patch)
treeed81a15ba59dc8c9ac089fa322c8e6a4b357fc16 /node
parent7ff1d6f1289d97ff0c8e66a71d06ac92fde09542 (diff)
downloaddexon-031fe42b08bb576b250a81e1e3885f15910551c5.tar
dexon-031fe42b08bb576b250a81e1e3885f15910551c5.tar.gz
dexon-031fe42b08bb576b250a81e1e3885f15910551c5.tar.bz2
dexon-031fe42b08bb576b250a81e1e3885f15910551c5.tar.lz
dexon-031fe42b08bb576b250a81e1e3885f15910551c5.tar.xz
dexon-031fe42b08bb576b250a81e1e3885f15910551c5.tar.zst
dexon-031fe42b08bb576b250a81e1e3885f15910551c5.zip
dex: move dexcon blockdb into datadir
Diffstat (limited to 'node')
-rw-r--r--node/node.go2
-rw-r--r--node/service.go8
2 files changed, 5 insertions, 5 deletions
diff --git a/node/node.go b/node/node.go
index ffa9fa1b0..5f2c30e9b 100644
--- a/node/node.go
+++ b/node/node.go
@@ -170,8 +170,8 @@ func (n *Node) Start() error {
for _, constructor := range n.serviceFuncs {
// Create a new context for the particular service
ctx := &ServiceContext{
- config: n.config,
services: make(map[reflect.Type]Service),
+ Config: n.config,
ServerConfig: &n.serverConfig,
EventMux: n.eventmux,
AccountManager: n.accman,
diff --git a/node/service.go b/node/service.go
index 7f9683362..380f01c0f 100644
--- a/node/service.go
+++ b/node/service.go
@@ -30,8 +30,8 @@ import (
// the protocol stack, that is passed to all constructors to be optionally used;
// as well as utility methods to operate on the service environment.
type ServiceContext struct {
- config *Config
services map[reflect.Type]Service // Index of the already constructed services
+ Config *Config
ServerConfig *p2p.Config
EventMux *event.TypeMux // Event multiplexer used for decoupled notifications
AccountManager *accounts.Manager // Account manager created by the node.
@@ -41,10 +41,10 @@ type ServiceContext struct {
// if no previous can be found) from within the node's data directory. If the
// node is an ephemeral one, a memory database is returned.
func (ctx *ServiceContext) OpenDatabase(name string, cache int, handles int) (ethdb.Database, error) {
- if ctx.config.DataDir == "" {
+ if ctx.Config.DataDir == "" {
return ethdb.NewMemDatabase(), nil
}
- db, err := ethdb.NewLDBDatabase(ctx.config.ResolvePath(name), cache, handles)
+ db, err := ethdb.NewLDBDatabase(ctx.Config.ResolvePath(name), cache, handles)
if err != nil {
return nil, err
}
@@ -55,7 +55,7 @@ func (ctx *ServiceContext) OpenDatabase(name string, cache int, handles int) (et
// and if the user actually uses persistent storage. It will return an empty string
// for emphemeral storage and the user's own input for absolute paths.
func (ctx *ServiceContext) ResolvePath(path string) string {
- return ctx.config.ResolvePath(path)
+ return ctx.Config.ResolvePath(path)
}
// Service retrieves a currently running service registered of a specific type.