aboutsummaryrefslogtreecommitdiffstats
path: root/core/state/statedb.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/state/statedb.go')
-rw-r--r--core/state/statedb.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/state/statedb.go b/core/state/statedb.go
index 3e25e0c16..8ba81613d 100644
--- a/core/state/statedb.go
+++ b/core/state/statedb.go
@@ -324,7 +324,9 @@ func (self *StateDB) Copy() *StateDB {
state, _ := New(common.Hash{}, self.db)
state.trie = self.trie
for k, stateObject := range self.stateObjects {
- state.stateObjects[k] = stateObject.Copy()
+ if stateObject.dirty {
+ state.stateObjects[k] = stateObject.Copy()
+ }
}
state.refund.Set(self.refund)
@@ -364,7 +366,6 @@ func (s *StateDB) IntermediateRoot() common.Hash {
stateObject.Update()
s.UpdateStateObject(stateObject)
}
- stateObject.dirty = false
}
}
return s.trie.Hash()