diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-09 01:09:36 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-09 01:09:36 +0800 |
commit | 5a0bae1dae831818740a2f20ca308c4176f5201d (patch) | |
tree | 33fc52996530ebb7c467880975554a91d94471c6 /ethchain/vm.go | |
parent | e8fb965ccbb65807c1f462e8f2ee82508a822b58 (diff) | |
download | go-tangerine-5a0bae1dae831818740a2f20ca308c4176f5201d.tar go-tangerine-5a0bae1dae831818740a2f20ca308c4176f5201d.tar.gz go-tangerine-5a0bae1dae831818740a2f20ca308c4176f5201d.tar.bz2 go-tangerine-5a0bae1dae831818740a2f20ca308c4176f5201d.tar.lz go-tangerine-5a0bae1dae831818740a2f20ca308c4176f5201d.tar.xz go-tangerine-5a0bae1dae831818740a2f20ca308c4176f5201d.tar.zst go-tangerine-5a0bae1dae831818740a2f20ca308c4176f5201d.zip |
Auto update state changes notifications
Diffstat (limited to 'ethchain/vm.go')
-rw-r--r-- | ethchain/vm.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/ethchain/vm.go b/ethchain/vm.go index ee470c269..584c66611 100644 --- a/ethchain/vm.go +++ b/ethchain/vm.go @@ -395,10 +395,10 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro case oSSTORE: require(2) val, loc := stack.Popn() - closure.SetMem(loc, ethutil.NewValue(val)) + closure.SetStorage(loc, ethutil.NewValue(val)) // Add the change to manifest - vm.stateManager.manifest.AddStorageChange(closure.Object(), loc.Bytes(), val) + vm.state.manifest.AddStorageChange(closure.Object(), loc.Bytes(), val) case oJUMP: require(1) pc = stack.Pop() @@ -473,7 +473,6 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro // Fetch the contract which will serve as the closure body contract := vm.state.GetContract(addr.Bytes()) - fmt.Println("before", contract.Amount) if contract != nil { // Prepay for the gas @@ -497,12 +496,9 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro //contract.State().Reset() } else { stack.Push(ethutil.BigTrue) - // Notify of the changes - vm.stateManager.manifest.AddObjectChange(contract) } vm.state.SetStateObject(contract) - fmt.Println("after", contract.Amount) mem.Set(retOffset.Int64(), retSize.Int64(), ret) } else { @@ -520,8 +516,7 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro receiver := vm.state.GetAccount(stack.Pop().Bytes()) receiver.AddAmount(closure.object.Amount) - - vm.stateManager.manifest.AddObjectChange(receiver) + vm.state.SetStateObject(receiver) closure.object.state.Purge() |