light: fix memory expansion bug (same as fix for core/state)

pull/3009/head
Gustav Simonsson 8 years ago
parent c8d6efd602
commit 22eea17b06
  1. 2
      light/state.go
  2. 2
      light/state_object.go

@ -261,8 +261,10 @@ func (self *LightState) Copy() *LightState {
state := NewLightState(common.Hash{}, self.odr)
state.trie = self.trie
for k, stateObject := range self.stateObjects {
if stateObject.dirty {
state.stateObjects[k] = stateObject.Copy()
}
}
return state
}

@ -186,7 +186,7 @@ func (self *StateObject) Copy() *StateObject {
stateObject.codeHash = common.CopyBytes(self.codeHash)
stateObject.nonce = self.nonce
stateObject.trie = self.trie
stateObject.code = common.CopyBytes(self.code)
stateObject.code = self.code
stateObject.storage = self.storage.Copy()
stateObject.remove = self.remove
stateObject.dirty = self.dirty

Loading…
Cancel
Save