mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core: add rlock for pendingState read access
This commit is contained in:
parent
3f60e5b215
commit
b49f3bf2c5
1 changed files with 3 additions and 0 deletions
|
|
@ -420,6 +420,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 a new issue