diff --git a/libethereum/Executive.cpp b/libethereum/Executive.cpp index fe5b21761..193010cfa 100644 --- a/libethereum/Executive.cpp +++ b/libethereum/Executive.cpp @@ -66,7 +66,7 @@ bool Executive::setup(bytesConstRef _rlp) } // Check gas cost is enough. - u256 gasCost = u256(m_t.data.size()) * c_txDataGas + c_txGas; + u256 gasCost = m_t.data.size() * c_txDataGas + c_txGas; if (m_t.gas < gasCost) { diff --git a/libethereum/Interface.h b/libethereum/Interface.h index e746ae760..7ae650590 100644 --- a/libethereum/Interface.h +++ b/libethereum/Interface.h @@ -123,7 +123,7 @@ public: virtual Addresses addresses(int _block) const = 0; /// Get the fee associated for a transaction with the given data. - static u256 txGas(unsigned _dataCount, u256 _gas = 0) { return u256(c_txDataGas) * _dataCount + c_txGas + _gas; } + static u256 txGas(unsigned _dataCount, u256 _gas = 0) { return c_txDataGas * _dataCount + c_txGas + _gas; } /// Get the remaining gas limit in this block. virtual u256 gasLimitRemaining() const = 0; diff --git a/libevm/VM.h b/libevm/VM.h index e092bdfed..2eb34ed04 100644 --- a/libevm/VM.h +++ b/libevm/VM.h @@ -168,13 +168,13 @@ template dev::bytesConstRef dev::eth::VM::go(Ext& _ext, OnOpFunc con case Instruction::CALL: require(7); - runGas = bigint(c_callGas) + m_stack[m_stack.size() - 1]; + runGas = c_callGas + m_stack[m_stack.size() - 1]; newTempSize = std::max(memNeed(m_stack[m_stack.size() - 6], m_stack[m_stack.size() - 7]), memNeed(m_stack[m_stack.size() - 4], m_stack[m_stack.size() - 5])); break; case Instruction::CALLCODE: require(7); - runGas = bigint(c_callGas) + m_stack[m_stack.size() - 1]; + runGas = c_callGas + m_stack[m_stack.size() - 1]; newTempSize = std::max(memNeed(m_stack[m_stack.size() - 6], m_stack[m_stack.size() - 7]), memNeed(m_stack[m_stack.size() - 4], m_stack[m_stack.size() - 5])); break;