diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-14 04:57:03 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-14 04:57:03 +0800 |
commit | d423305f07fe5390ca957a9f08c93b5e6a3cbef2 (patch) | |
tree | 0cad39365af337f749c98efa0e2376869158cd45 /core | |
parent | d61ec9ca76b3d3eefaf4218a0e8e0b44ccd0df0f (diff) | |
download | dexon-d423305f07fe5390ca957a9f08c93b5e6a3cbef2.tar dexon-d423305f07fe5390ca957a9f08c93b5e6a3cbef2.tar.gz dexon-d423305f07fe5390ca957a9f08c93b5e6a3cbef2.tar.bz2 dexon-d423305f07fe5390ca957a9f08c93b5e6a3cbef2.tar.lz dexon-d423305f07fe5390ca957a9f08c93b5e6a3cbef2.tar.xz dexon-d423305f07fe5390ca957a9f08c93b5e6a3cbef2.tar.zst dexon-d423305f07fe5390ca957a9f08c93b5e6a3cbef2.zip |
state: fixed nonce issue in managed state
Rlock => Lock when creating a new nonce
Diffstat (limited to 'core')
-rw-r--r-- | core/state/managed_state.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/state/managed_state.go b/core/state/managed_state.go index 9d2fc48e7..97d098039 100644 --- a/core/state/managed_state.go +++ b/core/state/managed_state.go @@ -52,8 +52,8 @@ func (ms *ManagedState) RemoveNonce(addr common.Address, n uint64) { // NewNonce returns the new canonical nonce for the managed account func (ms *ManagedState) NewNonce(addr common.Address) uint64 { - ms.mu.RLock() - defer ms.mu.RUnlock() + ms.mu.Lock() + defer ms.mu.Unlock() account := ms.getAccount(addr) for i, nonce := range account.nonces { |