aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-05-12 17:28:33 +0800
committerobscuren <geffobscura@gmail.com>2015-05-12 17:28:55 +0800
commit13f8f65a58bc9a31c8900e12ae2c3ed10003486f (patch)
tree6e03c6cb52ac2e6838df370079c1a23424b23fa0 /eth/backend.go
parent76215ca9f3c22b97d81b492026691a692cc2ce1a (diff)
downloadgo-tangerine-13f8f65a58bc9a31c8900e12ae2c3ed10003486f.tar.gz
go-tangerine-13f8f65a58bc9a31c8900e12ae2c3ed10003486f.tar.zst
go-tangerine-13f8f65a58bc9a31c8900e12ae2c3ed10003486f.zip
eth, ethdb: lower the amount of open files & improve err messages for db
Closes #880
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/eth/backend.go b/eth/backend.go
index 6be871138..80da30086 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -207,21 +207,24 @@ func New(config *Config) (*Ethereum, error) {
logger.NewJSONsystem(config.DataDir, config.LogJSON)
}
+ const dbCount = 3
+ ethdb.OpenFileLimit = 256 / (dbCount + 1)
+
newdb := config.NewDB
if newdb == nil {
newdb = func(path string) (common.Database, error) { return ethdb.NewLDBDatabase(path) }
}
blockDb, err := newdb(path.Join(config.DataDir, "blockchain"))
if err != nil {
- return nil, err
+ return nil, fmt.Errorf("blockchain db err: %v", err)
}
stateDb, err := newdb(path.Join(config.DataDir, "state"))
if err != nil {
- return nil, err
+ return nil, fmt.Errorf("state db err: %v", err)
}
extraDb, err := newdb(path.Join(config.DataDir, "extra"))
if err != nil {
- return nil, err
+ return nil, fmt.Errorf("extra db err: %v", err)
}
nodeDb := path.Join(config.DataDir, "nodes")