aboutsummaryrefslogtreecommitdiffstats
path: root/eth
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 /eth
parentc47866d25174bd783ee6bcd5b400d81d7bf598bb (diff)
downloaddexon-bdba044a8031d810555196cde1b97792fa2b8084.tar
dexon-bdba044a8031d810555196cde1b97792fa2b8084.tar.gz
dexon-bdba044a8031d810555196cde1b97792fa2b8084.tar.bz2
dexon-bdba044a8031d810555196cde1b97792fa2b8084.tar.lz
dexon-bdba044a8031d810555196cde1b97792fa2b8084.tar.xz
dexon-bdba044a8031d810555196cde1b97792fa2b8084.tar.zst
dexon-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 'eth')
-rw-r--r--eth/backend.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/eth/backend.go b/eth/backend.go
index 88708b997..7351b4168 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -132,13 +132,15 @@ type Ethereum struct {
logger logger.LogSystem
- Mining bool
+ Mining bool
+ DataDir string
}
func New(config *Config) (*Ethereum, error) {
// Boostrap database
ethlogger := logger.New(config.DataDir, config.LogFile, config.LogLevel, config.LogFormat)
- db, err := ethdb.NewLDBDatabase("blockchain")
+
+ db, err := ethdb.NewLDBDatabase(path.Join(config.DataDir, "blockchain"))
if err != nil {
return nil, err
}
@@ -175,6 +177,7 @@ func New(config *Config) (*Ethereum, error) {
blacklist: p2p.NewBlacklist(),
eventMux: &event.TypeMux{},
logger: ethlogger,
+ DataDir: config.DataDir,
}
eth.chainManager = core.NewChainManager(db, eth.EventMux())