diff --git a/arbnode/transaction_streamer.go b/arbnode/transaction_streamer.go index 1630fbbf87..0a17d5b5fc 100644 --- a/arbnode/transaction_streamer.go +++ b/arbnode/transaction_streamer.go @@ -1017,23 +1017,18 @@ func (s *TransactionStreamer) WriteMessageFromSequencer( MessageWithMeta: msgWithMeta, BlockHash: &msgResult.BlockHash, } - batch := s.db.NewBatch() - if err := s.writeMessages(pos, []arbostypes.MessageWithMetadataAndBlockHash{msgWithBlockHash}, batch); err != nil { + if err := s.writeMessages(pos, []arbostypes.MessageWithMetadataAndBlockHash{msgWithBlockHash}, s.db.NewBatch()); err != nil { return err } s.broadcastMessages([]arbostypes.MessageWithMetadataAndBlockHash{msgWithBlockHash}, pos) s.espressoTxnsStateInsertionMutex.Lock() defer s.espressoTxnsStateInsertionMutex.Unlock() - err = s.SubmitEspressoTransactionPos(pos, batch) + err = s.SubmitEspressoTransactionPos(pos, s.db.NewBatch()) if err != nil { return err } - err = batch.Write() - if err != nil { - return err - } return nil } @@ -1412,6 +1407,11 @@ func (s *TransactionStreamer) SubmitEspressoTransactionPos(pos arbutil.MessageIn return err } + err = batch.Write() + if err != nil { + return err + } + return nil }