core/state: avoid data race (#29924)

This commit is contained in:
rjl493456442 2024-06-04 20:51:34 +08:00 committed by GitHub
parent 682ae838b2
commit 125fb1ff58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1211,8 +1211,8 @@ func (s *StateDB) commit(deleteEmptyObjects bool) (*stateUpdate, error) {
} }
lock.Lock() lock.Lock()
updates[obj.addrHash] = update updates[obj.addrHash] = update
lock.Unlock()
s.StorageCommits = time.Since(start) // overwrite with the longest storage commit runtime s.StorageCommits = time.Since(start) // overwrite with the longest storage commit runtime
lock.Unlock()
return nil return nil
}) })
} }