core/state: opt stateObject.GetState

This commit is contained in:
Weixie Cui 2026-04-25 18:30:59 +08:00
parent 6ece4cd143
commit c63d796fbf

View file

@ -162,8 +162,12 @@ func (s *stateObject) getPrefetchedTrie() Trie {
// GetState retrieves a value associated with the given storage key. // GetState retrieves a value associated with the given storage key.
func (s *stateObject) GetState(key common.Hash) common.Hash { func (s *stateObject) GetState(key common.Hash) common.Hash {
value, _ := s.getState(key) value, dirty := s.dirtyStorage[key]
return value if dirty {
return value
}
origin := s.GetCommittedState(key)
return origin
} }
// getState retrieves a value associated with the given storage key, along with // getState retrieves a value associated with the given storage key, along with