Skip to content

Commit

Permalink
chg : modify stateObjectsMu
Browse files Browse the repository at this point in the history
  • Loading branch information
0xsharma committed Aug 4, 2023
1 parent 4d5cdae commit 6220893
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,9 @@ func (s *StateDB) getStateObject(addr common.Address) *stateObject {
// destructed object instead of wiping all knowledge about the state object.
func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject {
return MVRead(s, blockstm.NewAddressKey(addr), nil, func(s *StateDB) *stateObject {
s.stateObjectsMu.Lock()
defer s.stateObjectsMu.Unlock()

// Prefer live objects if any is available
if obj := s.stateObjects[addr]; obj != nil {
return obj
Expand Down Expand Up @@ -1000,9 +1003,6 @@ func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject {
}

func (s *StateDB) setStateObject(object *stateObject) {
s.stateObjectsMu.Lock()
defer s.stateObjectsMu.Unlock()

s.stateObjects[object.Address()] = object
}

Expand Down

0 comments on commit 6220893

Please sign in to comment.