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
This commit is contained in:
@ -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())
|
||||
|
Reference in New Issue
Block a user