mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
chg : modify stateObjectsMu
This commit is contained in:
parent
4d5cdae2e6
commit
62208934ad
1 changed files with 3 additions and 3 deletions
|
|
@ -936,6 +936,9 @@ func (s *StateDB) getStateObject(addr common.Address) *stateObject {
|
||||||
// destructed object instead of wiping all knowledge about the state object.
|
// destructed object instead of wiping all knowledge about the state object.
|
||||||
func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject {
|
func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject {
|
||||||
return MVRead(s, blockstm.NewAddressKey(addr), nil, func(s *StateDB) *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
|
// Prefer live objects if any is available
|
||||||
if obj := s.stateObjects[addr]; obj != nil {
|
if obj := s.stateObjects[addr]; obj != nil {
|
||||||
return obj
|
return obj
|
||||||
|
|
@ -1000,9 +1003,6 @@ func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StateDB) setStateObject(object *stateObject) {
|
func (s *StateDB) setStateObject(object *stateObject) {
|
||||||
s.stateObjectsMu.Lock()
|
|
||||||
defer s.stateObjectsMu.Unlock()
|
|
||||||
|
|
||||||
s.stateObjects[object.Address()] = object
|
s.stateObjects[object.Address()] = object
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue