Skip to content

Commit 803dc6b

Browse files
core/txpool/blobpool: revert #29989, WLock on Nonce (#30142)
1 parent 37590b2 commit 803dc6b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/txpool/blobpool/blobpool.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,8 +1598,9 @@ func (p *BlobPool) SubscribeTransactions(ch chan<- core.NewTxsEvent, reorgs bool
15981598
// Nonce returns the next nonce of an account, with all transactions executable
15991599
// by the pool already applied on top.
16001600
func (p *BlobPool) Nonce(addr common.Address) uint64 {
1601-
p.lock.RLock()
1602-
defer p.lock.RUnlock()
1601+
// We need a write lock here, since state.GetNonce might write the cache.
1602+
p.lock.Lock()
1603+
defer p.lock.Unlock()
16031604

16041605
if txs, ok := p.index[addr]; ok {
16051606
return txs[len(txs)-1].nonce + 1

0 commit comments

Comments
 (0)