Skip to content

Commit 6727d4a

Browse files
Merge pull request #668 from onflow/janez/remove-transaction-mutex
Remove transactions mutex
2 parents 1949a0a + 7627b4e commit 6727d4a

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

storage/pebble/transactions.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package pebble
22

33
import (
4-
"sync"
5-
64
"github.com/cockroachdb/pebble"
75
"github.com/onflow/go-ethereum/common"
86

@@ -14,20 +12,15 @@ var _ storage.TransactionIndexer = &Transactions{}
1412

1513
type Transactions struct {
1614
store *Storage
17-
mux sync.RWMutex
1815
}
1916

2017
func NewTransactions(store *Storage) *Transactions {
2118
return &Transactions{
2219
store: store,
23-
mux: sync.RWMutex{},
2420
}
2521
}
2622

2723
func (t *Transactions) Store(tx models.Transaction, batch *pebble.Batch) error {
28-
t.mux.Lock()
29-
defer t.mux.Unlock()
30-
3124
val, err := tx.MarshalBinary()
3225
if err != nil {
3326
return err
@@ -39,9 +32,6 @@ func (t *Transactions) Store(tx models.Transaction, batch *pebble.Batch) error {
3932
}
4033

4134
func (t *Transactions) Get(ID common.Hash) (models.Transaction, error) {
42-
t.mux.RLock()
43-
defer t.mux.RUnlock()
44-
4535
val, err := t.store.get(txIDKey, ID.Bytes())
4636
if err != nil {
4737
return nil, err

0 commit comments

Comments
 (0)