mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
Check current call depth
This commit is contained in:
parent
70348d9586
commit
6e318f8816
1 changed files with 4 additions and 0 deletions
|
|
@ -49,6 +49,8 @@ extern "C"
|
||||||
|
|
||||||
EXPORT void env_create(ExtVMFace* _env, i256* _endowment, byte* _initBeg, uint64_t _initSize, h256* o_address)
|
EXPORT void env_create(ExtVMFace* _env, i256* _endowment, byte* _initBeg, uint64_t _initSize, h256* o_address)
|
||||||
{
|
{
|
||||||
|
assert(_env->depth < 1024); // TODO: Handle call depth
|
||||||
|
|
||||||
auto endowment = llvm2eth(*_endowment);
|
auto endowment = llvm2eth(*_endowment);
|
||||||
|
|
||||||
if (_env->balance(_env->myAddress) >= endowment)
|
if (_env->balance(_env->myAddress) >= endowment)
|
||||||
|
|
@ -65,6 +67,8 @@ extern "C"
|
||||||
|
|
||||||
EXPORT bool env_call(ExtVMFace* _env, i256* io_gas, h256* _receiveAddress, i256* _value, byte* _inBeg, uint64_t _inSize, byte* _outBeg, uint64_t _outSize, h256* _codeAddress)
|
EXPORT bool env_call(ExtVMFace* _env, i256* io_gas, h256* _receiveAddress, i256* _value, byte* _inBeg, uint64_t _inSize, byte* _outBeg, uint64_t _outSize, h256* _codeAddress)
|
||||||
{
|
{
|
||||||
|
assert(_env->depth < 32); // TODO: Handle call depth
|
||||||
|
|
||||||
auto value = llvm2eth(*_value);
|
auto value = llvm2eth(*_value);
|
||||||
if (_env->balance(_env->myAddress) >= value)
|
if (_env->balance(_env->myAddress) >= value)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue