Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
facundomedica committed Feb 4, 2025
1 parent 13dfccd commit 270e906
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sequencing/transaction_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package sequencing
import (
"crypto/sha256"
"encoding/hex"
"errors"
"fmt"
"sync"

"github.com/dgraph-io/badger/v3"

Check failure on line 10 in sequencing/transaction_queue.go

View workflow job for this annotation

GitHub Actions / lint / golangci-lint

File is not properly formatted (goimports)
"github.com/rollkit/go-sequencing"
)

// BatchExtender is an interface for extending a batch of transactions
type BatchExtender interface {
Head(max uint64) ([]byte, error)
Tail(max uint64) ([]byte, error)
Expand Down Expand Up @@ -99,7 +101,7 @@ func (tq *TransactionQueue) GetNextBatch(max uint64, db *badger.DB) sequencing.B
_, err := txn.Get([]byte(txHash))
if err != nil {
// If the transaction not found is the head or tail, skip it as they are not in the queue
if err == badger.ErrKeyNotFound && (i == 0 || i == len(batch)-1) {
if errors.Is(err, badger.ErrKeyNotFound) && (i == 0 || i == len(batch)-1) {
return nil
}
return err
Expand Down

0 comments on commit 270e906

Please sign in to comment.