diff --git a/pkg/service.go b/pkg/service.go index 6785079..6add701 100644 --- a/pkg/service.go +++ b/pkg/service.go @@ -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())