From d9fbafe1109e91be9359c7ed5b3cc2d1c62906cc Mon Sep 17 00:00:00 2001 From: Fridrik Asmundsson Date: Tue, 28 Mar 2023 17:08:53 +0200 Subject: [PATCH] Address review comments --- chain/index/msgindex.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/chain/index/msgindex.go b/chain/index/msgindex.go index 42a536c16..39ba487f2 100644 --- a/chain/index/msgindex.go +++ b/chain/index/msgindex.go @@ -211,13 +211,9 @@ func PopulateAfterSnapshot(lctx context.Context, basePath string, cs ChainStore) insertStmt, err := tx.Prepare(dbqInsertMessage) if err != nil { + rollback() return xerrors.Errorf("error preparing insertStmt: %w", err) } - defer func() { - if err := insertStmt.Close(); err != nil { - log.Errorf("error closing insert statement: %s", err) - } - }() curTs := cs.GetHeaviestTipSet() startHeight := curTs.Height()