Pārlūkot izejas kodu

state: fixed nonce issue in managed state

Rlock => Lock when creating a new nonce
obscuren 10 gadi atpakaļ
vecāks
revīzija
d423305f07
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      core/state/managed_state.go

+ 2 - 2
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 {