aboutsummaryrefslogtreecommitdiffstats
path: root/ethdb
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-03-06 09:46:56 +0800
committerFelix Lange <fjl@twurst.com>2015-03-06 09:46:56 +0800
commitbdba044a8031d810555196cde1b97792fa2b8084 (patch)
tree4da485f83721176155a62b021ac2616de1929730 /ethdb
parentc47866d25174bd783ee6bcd5b400d81d7bf598bb (diff)
downloadgo-tangerine-bdba044a8031d810555196cde1b97792fa2b8084.tar
go-tangerine-bdba044a8031d810555196cde1b97792fa2b8084.tar.gz
go-tangerine-bdba044a8031d810555196cde1b97792fa2b8084.tar.bz2
go-tangerine-bdba044a8031d810555196cde1b97792fa2b8084.tar.lz
go-tangerine-bdba044a8031d810555196cde1b97792fa2b8084.tar.xz
go-tangerine-bdba044a8031d810555196cde1b97792fa2b8084.tar.zst
go-tangerine-bdba044a8031d810555196cde1b97792fa2b8084.zip
ethutil: remove Config variable
Various functions throughout the codebase used it to grab settings. This has to stop because I want to use them without reading the config file. These functions can now be used without reading the config first: * ethdb.NewLDBDatabase * ethrepl.NewJSRepl * vm.New
Diffstat (limited to 'ethdb')
-rw-r--r--ethdb/database.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/ethdb/database.go b/ethdb/database.go
index f020af8f2..4e3d01da0 100644
--- a/ethdb/database.go
+++ b/ethdb/database.go
@@ -1,11 +1,10 @@
package ethdb
import (
- "path"
"fmt"
- "github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/compression/rle"
+ "github.com/ethereum/go-ethereum/ethutil"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/iterator"
)
@@ -15,17 +14,13 @@ type LDBDatabase struct {
comp bool
}
-func NewLDBDatabase(name string) (*LDBDatabase, error) {
- dbPath := path.Join(ethutil.Config.ExecPath, name)
-
+func NewLDBDatabase(file string) (*LDBDatabase, error) {
// Open the db
- db, err := leveldb.OpenFile(dbPath, nil)
+ db, err := leveldb.OpenFile(file, nil)
if err != nil {
return nil, err
}
-
database := &LDBDatabase{db: db, comp: true}
-
return database, nil
}