mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 01:41:36 +00:00
core/state: opt stateObject.GetState
This commit is contained in:
parent
6ece4cd143
commit
c63d796fbf
1 changed files with 6 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue