Skip to content

Commit

Permalink
workarround for the error error closing batch
Browse files Browse the repository at this point in the history
  • Loading branch information
joanestebanr committed Jul 28, 2023
1 parent 6a6fc6f commit d6aa5e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion synchronizer/synchronizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,8 @@ func (s *ClientSynchronizer) processTrustedBatch(trustedBatch *types.Batch, dbTx

log.Debugf("closing batch %v", trustedBatch.Number)
if err := s.state.CloseBatch(s.ctx, receipt, dbTx); err != nil {
if err.Error() == state.ErrBatchAlreadyClosed.Error() {
// This is a workarround to avoid closing a batch that was already closed
if err.Error() != state.ErrBatchAlreadyClosed.Error() {
log.Errorf("error closing batch %d", trustedBatch.Number)
return nil, nil, err
} else {
Expand Down

0 comments on commit d6aa5e0

Please sign in to comment.