diff --git a/channeldb/db.go b/channeldb/db.go index 6b92f2287..b617d1008 100644 --- a/channeldb/db.go +++ b/channeldb/db.go @@ -479,6 +479,12 @@ func initChannelDB(db kvdb.Backend) error { return err } + for _, tlb := range dbTopLevelBuckets { + if _, err := tx.CreateTopLevelBucket(tlb); err != nil { + return err + } + } + meta := &Meta{} // Check if DB is already initialized. err := FetchMeta(meta, tx) @@ -486,12 +492,6 @@ func initChannelDB(db kvdb.Backend) error { return nil } - for _, tlb := range dbTopLevelBuckets { - if _, err := tx.CreateTopLevelBucket(tlb); err != nil { - return err - } - } - meta.DbVersionNumber = getLatestDBVersion(dbVersions) return putMeta(meta, tx) }, func() {})