Return gas left

This commit is contained in:
Paweł Bylica 2015-01-15 14:14:00 +01:00
parent e18d24c74e
commit b5b2ca72a2

View file

@ -126,6 +126,9 @@ func (self *JitVm) Run(me, caller ContextRef, code []byte, value, gas, price *bi
r := C.evmjit_run(unsafe.Pointer(&data), unsafe.Pointer(self))
fmt.Printf("JIT result: %d\n", r)
gasLeft := llvm2big(&data.elems[Gas]) // TODO: Set value directly to gas instance
gas.Set(gasLeft)
if r >= 100 {
err = errors.New("OOG from JIT")
}