Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unnecessary condition #15277

Merged
merged 5 commits into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions store/iavl/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,7 @@ func (st *Store) Export(version int64) (*iavl.Exporter, error) {
if !ok || tree == nil {
return nil, fmt.Errorf("iavl export failed: unable to fetch tree for version %v", version)
}
export, err := tree.Export()
if err != nil {
return nil, err
}
return export, nil
return tree.Export()
}

// Import imports an IAVL tree at the given version, returning an iavl.Importer for importing.
Expand Down
6 changes: 1 addition & 5 deletions store/rootmulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,10 +779,6 @@ func (rs *Store) Snapshot(height uint64, protoWriter protoio.Writer) error {
for _, store := range stores {
rs.logger.Debug("starting snapshot", "store", store.name, "height", height)
exporter, err := store.Export(int64(height))
if exporter == nil {
rs.logger.Error("snapshot failed; exporter is nil", "store", store.name)
return err
}
if err != nil {
rs.logger.Error("snapshot failed; exporter error", "store", store.name, "err", err)
return err
Expand All @@ -807,7 +803,7 @@ func (rs *Store) Snapshot(height uint64, protoWriter protoio.Writer) error {
for {
node, err := exporter.Next()
if err == iavltree.ErrorExportDone {
rs.logger.Debug("Snapshot Done", "store", store.name, "nodeCount", nodeCount)
rs.logger.Debug("snapshot Done", "store", store.name, "nodeCount", nodeCount)
nodeCount = 0
break
} else if err != nil {
Expand Down