Skip to content

Commit

Permalink
node: don't return non-nil database on error
Browse files Browse the repository at this point in the history
  • Loading branch information
fjl committed Jun 23, 2017
1 parent d40179f commit 01c9cf1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion node/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ func (ctx *ServiceContext) OpenDatabase(name string, cache int, handles int) (et
if ctx.config.DataDir == "" {
return ethdb.NewMemDatabase()
}
return ethdb.NewLDBDatabase(ctx.config.resolvePath(name), cache, handles)
db, err := ethdb.NewLDBDatabase(ctx.config.resolvePath(name), cache, handles)
if err != nil {
return nil, err
}
return db, nil
}

// ResolvePath resolves a user path into the data directory if that was relative
Expand Down

0 comments on commit 01c9cf1

Please sign in to comment.