commit
9bdbaf459a
|
@ -50,7 +50,7 @@ const (
|
|||
clientIdentifier = "Geth" // 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 = "0xfa7b9770ca4cb04296cac84f37736d4041251cdf" // Ethereum address of the Geth release oracle
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -149,10 +149,11 @@ func TestSnapshot2(t *testing.T) {
|
|||
so0.balance = big.NewInt(42)
|
||||
so0.nonce = 43
|
||||
so0.SetCode([]byte{'c', 'a', 'f', 'e'})
|
||||
so0.remove = true
|
||||
so0.remove = false
|
||||
so0.deleted = false
|
||||
so0.dirty = false
|
||||
so0.dirty = true
|
||||
state.SetStateObject(so0)
|
||||
state.Commit()
|
||||
|
||||
// and one with deleted == true
|
||||
so1 := state.GetStateObject(stateobjaddr1)
|
||||
|
@ -173,6 +174,7 @@ func TestSnapshot2(t *testing.T) {
|
|||
state.Set(snapshot)
|
||||
|
||||
so0Restored := state.GetStateObject(stateobjaddr0)
|
||||
so0Restored.GetState(storageaddr)
|
||||
so1Restored := state.GetStateObject(stateobjaddr1)
|
||||
// non-deleted is equal (restored)
|
||||
compareStateObjects(so0Restored, so0, t)
|
||||
|
|
|
@ -324,8 +324,10 @@ func (self *StateDB) Copy() *StateDB {
|
|||
state, _ := New(common.Hash{}, self.db)
|
||||
state.trie = self.trie
|
||||
for k, stateObject := range self.stateObjects {
|
||||
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()
|
||||
|
|
Loading…
Reference in New Issue