Skip to content

Commit 0b94bc1

Browse files
committed
Add lock-protection on writes to eoaActivityMetadata
1 parent 80ce2ad commit 0b94bc1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

services/requester/batch_tx_pool.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,11 @@ func (t *BatchTxPool) Add(
191191
return err
192192
}
193193

194+
t.txMux.Lock()
195+
defer t.txMux.Unlock()
196+
194197
// Update metadata for the last EOA activity only on successful add/submit.
198+
eoaActivity, _ = t.eoaActivityCache.Get(from)
195199
eoaActivity.lastSubmission = time.Now()
196200
eoaActivity.txNonces = append(eoaActivity.txNonces, nonce)
197201
// To avoid the slice of nonces from growing indefinitely,

0 commit comments

Comments
 (0)