From 014a0ee274a1ec161278cf172f57a1344c74529b Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 3 Mar 2015 13:52:53 +0100 Subject: [PATCH] VM CALLCODE fix. --- libethcore/Params.h | 18 ------------------ libevm/VM.cpp | 2 +- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/libethcore/Params.h b/libethcore/Params.h index 242a44ddd..9109347dc 100644 --- a/libethcore/Params.h +++ b/libethcore/Params.h @@ -29,16 +29,6 @@ namespace eth { //--- BEGIN: AUTOGENERATED FROM /feeStructure.json -extern u256 const c_genesisDifficulty; -extern u256 const c_maximumExtraDataSize; -extern u256 const c_epochDuration; -extern u256 const c_genesisGasLimit; -extern u256 const c_minGasLimit; -extern u256 const c_gasLimitBoundDivisor; -extern u256 const c_minimumDifficulty; -extern u256 const c_difficultyBoundDivisor; -extern u256 const c_durationLimit; - extern u256 const c_tierStepGas[8]; ///< Once per operation, for a selection of them. extern u256 const c_expGas; ///< Once per EXP instuction. extern u256 const c_expByteGas; ///< Times ceil(log256(exponent)) for the EXP instruction. @@ -74,13 +64,5 @@ extern u256 const c_ripemd160WordGas; extern u256 const c_identityGas; extern u256 const c_identityWordGas; -extern u256 const c_ecrecoverGas; -extern u256 const c_sha256Gas; -extern u256 const c_sha256WordGas; -extern u256 const c_ripemd160Gas; -extern u256 const c_ripemd160WordGas; -extern u256 const c_identityGas; -extern u256 const c_identityWordGas; - } } diff --git a/libevm/VM.cpp b/libevm/VM.cpp index 4592b7dcd..e0b487c9b 100644 --- a/libevm/VM.cpp +++ b/libevm/VM.cpp @@ -164,7 +164,7 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) case Instruction::CALL: case Instruction::CALLCODE: runGas = (bigint)c_callGas + m_stack[m_stack.size() - 1]; - if (!_ext.exists(asAddress(m_stack[m_stack.size() - 2]))) + if (inst != Instruction::CALLCODE && !_ext.exists(asAddress(m_stack[m_stack.size() - 2]))) runGas += c_callNewAccountGas; if (m_stack[m_stack.size() - 3] > 0) runGas += c_callValueTransferGas;