cmd, eth, ethdb, node: prioritise chaindata for resources, bump cache

This commit is contained in:
Péter Szilágyi
2016-02-19 14:29:19 +02:00
parent 05c86c2c9f
commit e90958cd29
13 changed files with 176 additions and 24 deletions

View File

@ -38,11 +38,11 @@ type ServiceContext struct {
// OpenDatabase opens an existing database with the given name (or creates one
// if no previous can be found) from within the node's data directory. If the
// node is an ephemeral one, a memory database is returned.
func (ctx *ServiceContext) OpenDatabase(name string, cache int) (ethdb.Database, error) {
func (ctx *ServiceContext) OpenDatabase(name string, cache int, handles int) (ethdb.Database, error) {
if ctx.datadir == "" {
return ethdb.NewMemDatabase()
}
return ethdb.NewLDBDatabase(filepath.Join(ctx.datadir, name), cache)
return ethdb.NewLDBDatabase(filepath.Join(ctx.datadir, name), cache, handles)
}
// Service retrieves a currently running service registered of a specific type.