diff options
author | obscuren <geffobscura@gmail.com> | 2014-07-30 06:31:15 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-07-30 06:31:15 +0800 |
commit | 1f9894c0845a5259adbfd30fe3a86631e6403b8d (patch) | |
tree | 7e038ca62c65482d576d3a8b3fde5419ac866f2f /ethvm/vm.go | |
parent | 27f892265312255811867fab83acbeefa1626cec (diff) | |
download | dexon-1f9894c0845a5259adbfd30fe3a86631e6403b8d.tar dexon-1f9894c0845a5259adbfd30fe3a86631e6403b8d.tar.gz dexon-1f9894c0845a5259adbfd30fe3a86631e6403b8d.tar.bz2 dexon-1f9894c0845a5259adbfd30fe3a86631e6403b8d.tar.lz dexon-1f9894c0845a5259adbfd30fe3a86631e6403b8d.tar.xz dexon-1f9894c0845a5259adbfd30fe3a86631e6403b8d.tar.zst dexon-1f9894c0845a5259adbfd30fe3a86631e6403b8d.zip |
Old code removed and renamed amount to balance
Diffstat (limited to 'ethvm/vm.go')
-rw-r--r-- | ethvm/vm.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ethvm/vm.go b/ethvm/vm.go index e0a9d831b..e469fa826 100644 --- a/ethvm/vm.go +++ b/ethvm/vm.go @@ -682,7 +682,7 @@ func (self *Vm) RunClosure(closure *Closure) (ret []byte, err error) { // Create a new contract contract := self.env.State().NewStateObject(addr) - if contract.Amount.Cmp(value) >= 0 { + if contract.Balance.Cmp(value) >= 0 { closure.object.SubAmount(value) contract.AddAmount(value) @@ -700,7 +700,7 @@ func (self *Vm) RunClosure(closure *Closure) (ret []byte, err error) { // main script. contract.Code, _, err = c.Call(self, nil) } else { - err = fmt.Errorf("Insufficient funds to transfer value. Req %v, has %v", value, closure.object.Amount) + err = fmt.Errorf("Insufficient funds to transfer value. Req %v, has %v", value, closure.object.Balance) } if err != nil { @@ -736,8 +736,8 @@ func (self *Vm) RunClosure(closure *Closure) (ret []byte, err error) { // Get the arguments from the memory args := mem.Get(inOffset.Int64(), inSize.Int64()) - if closure.object.Amount.Cmp(value) < 0 { - vmlogger.Debugf("Insufficient funds to transfer value. Req %v, has %v", value, closure.object.Amount) + if closure.object.Balance.Cmp(value) < 0 { + vmlogger.Debugf("Insufficient funds to transfer value. Req %v, has %v", value, closure.object.Balance) closure.ReturnGas(gas, nil) @@ -784,7 +784,7 @@ func (self *Vm) RunClosure(closure *Closure) (ret []byte, err error) { receiver := self.env.State().GetOrNewStateObject(stack.Pop().Bytes()) - receiver.AddAmount(closure.object.Amount) + receiver.AddAmount(closure.object.Balance) closure.object.MarkForDeletion() |