Precompiled contract & Depth change

* Added pre-compiled contract 0x04 (mem cpy)
* Changed depth error to return the gas instead of consuming
This commit is contained in:
obscuren
2015-01-05 17:37:30 +01:00
parent d001479a47
commit b99b2c446c
3 changed files with 19 additions and 1 deletions

View File

@ -36,7 +36,8 @@ func (self *Execution) exec(code, contextAddr []byte, caller vm.ContextRef) (ret
evm := vm.New(env, vm.DebugVmTy)
if env.Depth() == vm.MaxCallDepth {
// Consume all gas (by not returning it) and return a depth error
caller.ReturnGas(self.Gas, self.price)
return nil, vm.DepthError{}
}