From da47c884113f4bbf103c085a6fc7af75a99323fc Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 7 Apr 2015 14:03:57 +0200 Subject: [PATCH] Retain more gas for the case that the called contract is not yet created. --- ExpressionCompiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp index daea21623..fb50fd2a7 100644 --- a/ExpressionCompiler.cpp +++ b/ExpressionCompiler.cpp @@ -1029,7 +1029,7 @@ void ExpressionCompiler::appendExternalFunctionCall(FunctionType const& _functio else // send all gas except the amount needed to execute "SUB" and "CALL" // @todo this retains too much gas for now, needs to be fine-tuned. - m_context << u256(50 + (_functionType.valueSet() ? 9000 : 0)) << eth::Instruction::GAS << eth::Instruction::SUB; + m_context << u256(50 + (_functionType.valueSet() ? 9000 : 0) + 25000) << eth::Instruction::GAS << eth::Instruction::SUB; m_context << eth::Instruction::CALL; auto tag = m_context.appendConditionalJump(); m_context << eth::Instruction::STOP << tag; // STOP if CALL leaves 0.