good morning!!!!

Skip to content
Snippets Groups Projects
Commit 6426f363 authored by Jeffrey Wilcke's avatar Jeffrey Wilcke
Browse files

Forgot to return gas when CALL's value transfer fails

parent ee3ba0b1
No related branches found
No related tags found
No related merge requests found
...@@ -550,8 +550,10 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) { ...@@ -550,8 +550,10 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
} }
code := closure.Script[cOff : cOff+l] code := closure.Script[cOff : cOff+l]
fmt.Println("len:", l, "code off:", cOff, "mem off:", mOff)
mem.Set(mOff, l, code) mem.Set(mOff, l, code)
fmt.Println(Code(mem.Get(mOff, l)))
case GASPRICE: case GASPRICE:
stack.Push(closure.Price) stack.Push(closure.Price)
...@@ -741,6 +743,7 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) { ...@@ -741,6 +743,7 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
if closure.object.Amount.Cmp(value) < 0 { if closure.object.Amount.Cmp(value) < 0 {
vmlogger.Debugf("Insufficient funds to transfer value. Req %v, has %v", value, closure.object.Amount) vmlogger.Debugf("Insufficient funds to transfer value. Req %v, has %v", value, closure.object.Amount)
closure.ReturnGas(gas, nil, nil)
stack.Push(ethutil.BigFalse) stack.Push(ethutil.BigFalse)
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment