aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-07-13 23:56:14 +0800
committerobscuren <geffobscura@gmail.com>2014-07-13 23:56:14 +0800
commit6426f3635eddaa1477e643886fd3c0eaf1fa6158 (patch)
treee337e7caa29a64d9decff239508ee435b1e3c45a
parentee3ba0b1d611401864bf0a646e9608d5ba03be34 (diff)
downloadgo-tangerine-6426f3635eddaa1477e643886fd3c0eaf1fa6158.tar
go-tangerine-6426f3635eddaa1477e643886fd3c0eaf1fa6158.tar.gz
go-tangerine-6426f3635eddaa1477e643886fd3c0eaf1fa6158.tar.bz2
go-tangerine-6426f3635eddaa1477e643886fd3c0eaf1fa6158.tar.lz
go-tangerine-6426f3635eddaa1477e643886fd3c0eaf1fa6158.tar.xz
go-tangerine-6426f3635eddaa1477e643886fd3c0eaf1fa6158.tar.zst
go-tangerine-6426f3635eddaa1477e643886fd3c0eaf1fa6158.zip
Forgot to return gas when CALL's value transfer fails
-rw-r--r--ethchain/vm.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/ethchain/vm.go b/ethchain/vm.go
index f7ce8c2ce..f1794ff77 100644
--- a/ethchain/vm.go
+++ b/ethchain/vm.go
@@ -550,8 +550,10 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
}
code := closure.Script[cOff : cOff+l]
+ fmt.Println("len:", l, "code off:", cOff, "mem off:", mOff)
mem.Set(mOff, l, code)
+ fmt.Println(Code(mem.Get(mOff, l)))
case GASPRICE:
stack.Push(closure.Price)
@@ -741,6 +743,7 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
if closure.object.Amount.Cmp(value) < 0 {
vmlogger.Debugf("Insufficient funds to transfer value. Req %v, has %v", value, closure.object.Amount)
+ closure.ReturnGas(gas, nil, nil)
stack.Push(ethutil.BigFalse)
} else {