cmd, core, eth, ethdb: cache flag to allocate memory for db internal use
This commit is contained in:
@ -80,6 +80,7 @@ type Config struct {
|
||||
|
||||
BlockChainVersion int
|
||||
SkipBcVersionCheck bool // e.g. blockchain export
|
||||
DatabaseCache int
|
||||
|
||||
DataDir string
|
||||
LogFile string
|
||||
@ -261,7 +262,7 @@ func New(config *Config) (*Ethereum, error) {
|
||||
|
||||
newdb := config.NewDB
|
||||
if newdb == nil {
|
||||
newdb = func(path string) (common.Database, error) { return ethdb.NewLDBDatabase(path) }
|
||||
newdb = func(path string) (common.Database, error) { return ethdb.NewLDBDatabase(path, config.DatabaseCache) }
|
||||
}
|
||||
blockDb, err := newdb(filepath.Join(config.DataDir, "blockchain"))
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user