forked from cerc-io/plugeth
core: fix datarace in txpool pendingnoce, fixes #25870
This commit is contained in:
parent
a3c6d1d9b6
commit
e004e7d256
@ -463,6 +463,9 @@ func (pool *TxPool) SetGasPrice(price *big.Int) {
|
||||
// Nonce returns the next nonce of an account, with all transactions executable
|
||||
// by the pool already applied on top.
|
||||
func (pool *TxPool) Nonce(addr common.Address) uint64 {
|
||||
pool.mu.RLock()
|
||||
defer pool.mu.RUnlock()
|
||||
|
||||
return pool.pendingNonces.get(addr)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user