fail before defer statement

This commit is contained in:
2020-11-06 00:58:04 +08:00
parent 566dcd3a1d
commit ddc84744ce
+3
View File
@@ -529,6 +529,9 @@ func (sds *Service) writeStateDiff(block *types.Block, parentRoot common.Hash, p
receipts = sds.BlockChain.GetReceiptsByHash(block.Hash())
}
tx, err := sds.indexer.PushBlock(block, receipts, totalDifficulty)
if err != nil {
return err
}
// defer handling of commit/rollback for any return case
defer tx.Close()
output := func(node StateNode) error {