Skip to content

Commit

Permalink
Delete double close calls
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisPH3 committed Dec 13, 2024
1 parent 0bf3d11 commit 91801fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/sonictool/app/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func gfileGenesisImport(ctx *cli.Context) (err error) {
if err != nil {
return fmt.Errorf("failed to open the genesis file: %w", err)
}
defer caution.CloseAndReportError(&err, genesisReader, "failed to close the genesis file")
// note, genesisStore closes the reader, no need to defer close it here

genesisStore, genesisHashes, err := genesisstore.OpenGenesisStore(genesisReader)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/sonictool/app/sign_genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func getGenesisHeaderHashes(genesisFile string) (genesisHead ogenesis.Header, ge
err = fmt.Errorf("failed to open the genesis file: %w", err)
return
}
defer caution.CloseAndReportError(&err, genesisReader, "failed to close generis file")
// note, genesisStore closes the reader, no need to defer close it here

genesisStore, genesisHashes, err := genesisstore.OpenGenesisStore(genesisReader)
if err != nil {
Expand Down

0 comments on commit 91801fb

Please sign in to comment.