Skip to content

Commit

Permalink
Merge pull request #5 from elementrem/devlab_1.4
Browse files Browse the repository at this point in the history
[1.4.12] core/state: Fix memory expansion bug by not copying clean ob…
  • Loading branch information
elementrem committed Sep 19, 2016
2 parents dc1597a + 9de979a commit 9c8651d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.11
1.4.12
2 changes: 1 addition & 1 deletion cmd/gele/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const (
clientIdentifier = "Gele" // Client identifier to advertise over the network
versionMajor = 1 // Major version component of the current release
versionMinor = 4 // Minor version component of the current release
versionPatch = 11 // Patch version component of the current release
versionPatch = 12 // Patch version component of the current release
versionMeta = "stable" // Version metadata to append to the version string

versionOracle = "0x1a38d480bbd14caab0f8736345f81844d7d36abe" // Elementrem address of the Gele release oracle
Expand Down
2 changes: 1 addition & 1 deletion core/state/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,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.initCode = common.CopyBytes(self.initCode)
stateObject.storage = self.storage.Copy()
stateObject.remove = self.remove
Expand Down
5 changes: 3 additions & 2 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -364,7 +366,6 @@ func (s *StateDB) IntermediateRoot() common.Hash {
stateObject.Update()
s.UpdateStateObject(stateObject)
}
stateObject.dirty = false
}
}
return s.trie.Hash()
Expand Down

0 comments on commit 9c8651d

Please sign in to comment.