Commit b724d1aa authored by Felix Lange's avatar Felix Lange Committed by Péter Szilágyi

core/state: cache missing storage entries (#16584)

parent 86be91b3
...@@ -178,9 +178,7 @@ func (self *stateObject) GetState(db Database, key common.Hash) common.Hash { ...@@ -178,9 +178,7 @@ func (self *stateObject) GetState(db Database, key common.Hash) common.Hash {
} }
value.SetBytes(content) value.SetBytes(content)
} }
if (value != common.Hash{}) {
self.cachedStorage[key] = value self.cachedStorage[key] = value
}
return value return value
} }
...@@ -197,7 +195,6 @@ func (self *stateObject) SetState(db Database, key, value common.Hash) { ...@@ -197,7 +195,6 @@ func (self *stateObject) SetState(db Database, key, value common.Hash) {
func (self *stateObject) setState(key, value common.Hash) { func (self *stateObject) setState(key, value common.Hash) {
self.cachedStorage[key] = value self.cachedStorage[key] = value
self.dirtyStorage[key] = value self.dirtyStorage[key] = value
} }
// updateTrie writes cached storage modifications into the object's storage trie. // updateTrie writes cached storage modifications into the object's storage trie.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment