diff --git a/chain/index/msgindex.go b/chain/index/msgindex.go index d2686133c..cb18eee3b 100644 --- a/chain/index/msgindex.go +++ b/chain/index/msgindex.go @@ -147,9 +147,8 @@ func NewMsgIndex(basePath string, cs ChainStore) (MsgIndex, error) { err = msgIndex.prepareStatements() if err != nil { - err2 := db.Close() - if err2 != nil { - log.Errorf("error closing msgindex database: %s", err2) + if err := db.Close(); err != nil { + log.Errorf("error closing msgindex database: %s", err) } return nil, xerrors.Errorf("error preparing msgindex database statements: %w", err)