deferred rollback
Some checks failed
Tests / Run integration tests (pull_request) Failing after 3m40s
Tests / Run compliance tests (pull_request) Successful in 4m36s

This commit is contained in:
Roy Crihfield 2023-10-03 13:02:54 +08:00
parent 9072ebc91e
commit b305f541a4

View File

@ -404,6 +404,7 @@ func (sds *Service) writeStateDiff(block *types.Block, parentRoot common.Hash, p
if err != nil {
return err
}
defer tx.RollbackOnFailure(err)
// defer handling of commit/rollback for any return case
output := func(node sdtypes.StateLeafNode) error {
return sds.indexer.PushStateNode(tx, node, block.Hash().String())