From f12a6f789cb3534efbb77bc65967b2bd55e937eb Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 16 May 2017 15:22:50 +0200 Subject: [PATCH] gasLimit --- src/app/txRunner.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/app/txRunner.js b/src/app/txRunner.js index 2537750d27..f45b65dd4f 100644 --- a/src/app/txRunner.js +++ b/src/app/txRunner.js @@ -75,16 +75,12 @@ TxRunner.prototype.execute = function () { } else { // NOTE: estimateGas very likely will return a large limit if execution of the code failed // we want to be able to run the code in order to debug and find the cause for the failure - var blockGasLimit = Math.floor(block.gasLimit - block.gasLimit / 1024) - // tx.gas = blockGasLimit < gasEstimation ? blockGasLimit : gasEstimation - tx.gas = blockGasLimit // that's temporary, uncomment when the following is fixed https://github.com/ethereum/go-ethereum/issues/3653 - - /* same as above + // we can't use the blockGasLimit cause the next blocks could have a lower limit : https://github.com/ethereum/remix/issues/506 + var blockGasLimit = Math.floor(block.gasLimit - (5 * block.gasLimit) / 1024) + tx.gas = blockGasLimit if (tx.gas > gasLimit) { return callback('Gas required exceeds limit: ' + tx.gas) } - */ - var sendTransaction = self.personalMode ? self.web3.personal.sendTransaction : self.web3.eth.sendTransaction sendTransaction(tx, function (err, resp) { if (err) {