mirror of
https://github.com/0glabs/0g-chain.git
synced 2025-01-13 00:35:17 +00:00
correct rocksdb path -- ensure we use KAVA_HOME/data/application.db (#1767)
and not a nested application.db within that path
This commit is contained in:
parent
802f1c8112
commit
72063ddda9
@ -81,7 +81,7 @@ const (
|
|||||||
func OpenDB(appOpts types.AppOptions, home string, backendType dbm.BackendType) (dbm.DB, error) {
|
func OpenDB(appOpts types.AppOptions, home string, backendType dbm.BackendType) (dbm.DB, error) {
|
||||||
dataDir := filepath.Join(home, "data")
|
dataDir := filepath.Join(home, "data")
|
||||||
if backendType == dbm.RocksDBBackend {
|
if backendType == dbm.RocksDBBackend {
|
||||||
return openRocksdb(filepath.Join(dataDir, "application.db"), appOpts)
|
return openRocksdb(dataDir, appOpts)
|
||||||
}
|
}
|
||||||
|
|
||||||
return dbm.NewDB("application", backendType, dataDir)
|
return dbm.NewDB("application", backendType, dataDir)
|
||||||
@ -90,7 +90,8 @@ func OpenDB(appOpts types.AppOptions, home string, backendType dbm.BackendType)
|
|||||||
// openRocksdb loads existing options, overrides some of them with appOpts and opens database
|
// openRocksdb loads existing options, overrides some of them with appOpts and opens database
|
||||||
// option will be overridden only in case if it explicitly specified in appOpts
|
// option will be overridden only in case if it explicitly specified in appOpts
|
||||||
func openRocksdb(dir string, appOpts types.AppOptions) (dbm.DB, error) {
|
func openRocksdb(dir string, appOpts types.AppOptions) (dbm.DB, error) {
|
||||||
dbOpts, cfOpts, err := loadLatestOptions(dir)
|
optionsPath := filepath.Join(dir, "application.db")
|
||||||
|
dbOpts, cfOpts, err := loadLatestOptions(optionsPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user