Unverified Commit e004e7d2 authored by Martin Holst Swende's avatar Martin Holst Swende Committed by GitHub

core: fix datarace in txpool, fixes #25870 and #25869 (#25872)

core: fix datarace in txpool pendingnoce, fixes #25870
parent a3c6d1d9
......@@ -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)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment