Skip to content

Commit

Permalink
dont add this extra logic
Browse files Browse the repository at this point in the history
  • Loading branch information
czarcas7ic committed Dec 22, 2023
1 parent 8756631 commit b748a97
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions store/rootmulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -1064,9 +1064,7 @@ func (rs *Store) GetCommitInfo(ver int64) (*types.CommitInfo, error) {
func (rs *Store) flushMetadata(db dbm.DB, version int64, cInfo *types.CommitInfo) {
rs.logger.Debug("flushing metadata", "height", version)
batch := db.NewBatch()
defer func() {
_ = batch.Close()
}()
defer batch.Close()

if cInfo != nil {
flushCommitInfo(batch, version, cInfo)
Expand Down Expand Up @@ -1166,10 +1164,7 @@ func flushCommitInfo(batch dbm.Batch, version int64, cInfo *types.CommitInfo) {
}

cInfoKey := fmt.Sprintf(commitInfoKeyFmt, version)

if err := batch.Set([]byte(cInfoKey), bz); err != nil {
panic(err)
}
batch.Set([]byte(cInfoKey), bz)
}

func flushLatestVersion(batch dbm.Batch, version int64) {
Expand All @@ -1178,7 +1173,5 @@ func flushLatestVersion(batch dbm.Batch, version int64) {
panic(err)
}

if err := batch.Set([]byte(latestVersionKey), bz); err != nil {
panic(err)
}
batch.Set([]byte(latestVersionKey), bz)
}

0 comments on commit b748a97

Please sign in to comment.