Skip to content

Commit

Permalink
eth: gracefully error if database cannot be opened
Browse files Browse the repository at this point in the history
  • Loading branch information
karalabe committed Jun 23, 2017
1 parent b664bed commit d40179f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,13 @@ func makeExtraData(extra []byte) []byte {
// CreateDB creates the chain database.
func CreateDB(ctx *node.ServiceContext, config *Config, name string) (ethdb.Database, error) {
db, err := ctx.OpenDatabase(name, config.DatabaseCache, config.DatabaseHandles)
if err != nil {
return nil, err
}
if db, ok := db.(*ethdb.LDBDatabase); ok {
db.Meter("eth/db/chaindata/")
}
return db, err
return db, nil
}

// CreateConsensusEngine creates the required type of consensus engine instance for an Ethereum service
Expand Down

0 comments on commit d40179f

Please sign in to comment.