aboutsummaryrefslogtreecommitdiffstats
path: root/node
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2018-05-09 20:24:25 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-05-09 20:24:25 +0800
commit7beccb29becf439df7bf4c033a94c019ad25bead (patch)
tree5d8581c15f3f110c765c6383e0c4c7724418d6f0 /node
parent5dbd8b42a90779bd4269012c1336679fd4ca9824 (diff)
downloadgo-tangerine-7beccb29becf439df7bf4c033a94c019ad25bead.tar
go-tangerine-7beccb29becf439df7bf4c033a94c019ad25bead.tar.gz
go-tangerine-7beccb29becf439df7bf4c033a94c019ad25bead.tar.bz2
go-tangerine-7beccb29becf439df7bf4c033a94c019ad25bead.tar.lz
go-tangerine-7beccb29becf439df7bf4c033a94c019ad25bead.tar.xz
go-tangerine-7beccb29becf439df7bf4c033a94c019ad25bead.tar.zst
go-tangerine-7beccb29becf439df7bf4c033a94c019ad25bead.zip
all: get rid of error when creating memory database (#16716)
* all: get rid of error when create mdb * core: clean up variables definition * all: inline mdb definition
Diffstat (limited to 'node')
-rw-r--r--node/node.go2
-rw-r--r--node/service.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/node/node.go b/node/node.go
index 83b6c4c07..c4368189f 100644
--- a/node/node.go
+++ b/node/node.go
@@ -568,7 +568,7 @@ func (n *Node) EventMux() *event.TypeMux {
// ephemeral, a memory database is returned.
func (n *Node) OpenDatabase(name string, cache, handles int) (ethdb.Database, error) {
if n.config.DataDir == "" {
- return ethdb.NewMemDatabase()
+ return ethdb.NewMemDatabase(), nil
}
return ethdb.NewLDBDatabase(n.config.resolvePath(name), cache, handles)
}
diff --git a/node/service.go b/node/service.go
index 55062a500..afc43e848 100644
--- a/node/service.go
+++ b/node/service.go
@@ -41,7 +41,7 @@ type ServiceContext struct {
// 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 == "" {
- return ethdb.NewMemDatabase()
+ return ethdb.NewMemDatabase(), nil
}
db, err := ethdb.NewLDBDatabase(ctx.config.resolvePath(name), cache, handles)
if err != nil {