Skip to content

Commit d934507

Browse files
authored
Merge pull request #2697 from CortexFoundation/dev
opt stateObject.GetState
2 parents 80ef725 + 431c3ca commit d934507

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

core/state/state_object.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,11 @@ func (s *stateObject) getPrefetchedTrie() Trie {
172172

173173
// GetState retrieves a value from the account storage trie.
174174
func (s *stateObject) GetState(key common.Hash) common.Hash {
175-
value, _ := s.getState(key)
176-
return value
175+
value, dirty := s.dirtyStorage[key]
176+
if dirty {
177+
return value
178+
}
179+
return s.GetCommittedState(key)
177180
}
178181

179182
// getState retrieves a value associated with the given storage key, along with

0 commit comments

Comments
 (0)