aboutsummaryrefslogtreecommitdiffstats
path: root/node/service.go
diff options
context:
space:
mode:
Diffstat (limited to 'node/service.go')
-rw-r--r--node/service.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/node/service.go b/node/service.go
index 6a96d9b1e..4f6cb6676 100644
--- a/node/service.go
+++ b/node/service.go
@@ -20,6 +20,7 @@ import (
"reflect"
"github.com/ethereum/go-ethereum/accounts"
+ "github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/p2p"
@@ -39,11 +40,11 @@ type ServiceContext struct {
// OpenDatabase opens an existing database with the given name (or creates one
// 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) {
+func (ctx *ServiceContext) OpenDatabase(name string, cache int, handles int, namespace string) (ethdb.Database, error) {
if ctx.config.DataDir == "" {
- return ethdb.NewMemDatabase(), nil
+ return rawdb.NewMemoryDatabase(), nil
}
- db, err := ethdb.NewLDBDatabase(ctx.config.ResolvePath(name), cache, handles)
+ db, err := rawdb.NewLevelDBDatabase(ctx.config.ResolvePath(name), cache, handles, namespace)
if err != nil {
return nil, err
}