diff options
Diffstat (limited to 'core/state')
-rw-r--r-- | core/state/state_test.go | 2 | ||||
-rw-r--r-- | core/state/statedb.go | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/core/state/state_test.go b/core/state/state_test.go index 00e133dab..b63b8ae9b 100644 --- a/core/state/state_test.go +++ b/core/state/state_test.go @@ -72,7 +72,7 @@ func TestNull(t *testing.T) { //value := common.FromHex("0x823140710bf13990e4500136726d8b55") var value common.Hash state.SetState(address, common.Hash{}, value) - state.Update() + state.SyncIntermediate() state.Sync() value = state.GetState(address, common.Hash{}) if !common.EmptyHash(value) { diff --git a/core/state/statedb.go b/core/state/statedb.go index bd4ff6ff3..4ccda1fc7 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -324,7 +324,8 @@ func (self *StateDB) Refunds() *big.Int { return self.refund } -func (self *StateDB) Update() { +// SyncIntermediate updates the intermediate state and all mid steps +func (self *StateDB) SyncIntermediate() { self.refund = new(big.Int) for _, stateObject := range self.stateObjects { @@ -341,7 +342,8 @@ func (self *StateDB) Update() { } } -func (self *StateDB) CleanUpdate() { +// SyncObjects syncs the changed objects to the trie +func (self *StateDB) SyncObjects() { self.trie = trie.NewSecure(self.root[:], self.db) self.refund = new(big.Int) |