From 6f39924e60545ca8ac19995a799c16d0dea11b04 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 8 Nov 2016 08:32:34 -0800 Subject: Increase gas buffer Fixes #795 --- app/scripts/lib/idStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/scripts/lib/idStore.js') diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 1010a5789..8c811a614 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -287,7 +287,7 @@ IdentityStore.prototype.checkForDelegateCall = function (codeHex) { } } -const gasBuffer = new BN('100000', 10) +const gasBuffer = new BN('200000', 10) IdentityStore.prototype.addGasBuffer = function (gas) { const bnGas = new BN(ethUtil.stripHexPrefix(gas), 16) const correct = bnGas.add(gasBuffer) -- cgit v1.2.3 From 7068d2e71c6d1ddb68095916dc16f3ff1f283590 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 8 Nov 2016 08:39:41 -0800 Subject: Adjust gas buffer to be 20% over estimate --- app/scripts/lib/idStore.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/scripts/lib/idStore.js') diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 8c811a614..0ce91f471 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -287,9 +287,10 @@ IdentityStore.prototype.checkForDelegateCall = function (codeHex) { } } -const gasBuffer = new BN('200000', 10) IdentityStore.prototype.addGasBuffer = function (gas) { const bnGas = new BN(ethUtil.stripHexPrefix(gas), 16) + const five = new BN('5', 10) + const gasBuffer = bnGas.div(five) const correct = bnGas.add(gasBuffer) return ethUtil.addHexPrefix(correct.toString(16)) } -- cgit v1.2.3 From b6b4be61d9f01f309b8f4ce708fa1220f84a5d8f Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 9 Nov 2016 16:29:24 -0800 Subject: Fix bug for increasing gas by 20 percent. --- app/scripts/lib/idStore.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/scripts/lib/idStore.js') diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 0ce91f471..1d66ee368 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -262,6 +262,8 @@ IdentityStore.prototype.addUnconfirmedTransaction = function (txParams, onTxDone query.estimateGas(txParams, function(err, result){ if (err) return cb(err) txData.estimatedGas = self.addGasBuffer(result) + txData.txParams.gas = txData.estimatedGas + txData.txParams.gasLimit = txData.estimatedGas cb() }) } -- cgit v1.2.3 From e2b2083df03b3bd808193ed38536d07ba155ff58 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 9 Nov 2016 16:38:28 -0800 Subject: remove gas field, due to alias redundancy. --- app/scripts/lib/idStore.js | 1 - 1 file changed, 1 deletion(-) (limited to 'app/scripts/lib/idStore.js') diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 1d66ee368..dd895a6c0 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -262,7 +262,6 @@ IdentityStore.prototype.addUnconfirmedTransaction = function (txParams, onTxDone query.estimateGas(txParams, function(err, result){ if (err) return cb(err) txData.estimatedGas = self.addGasBuffer(result) - txData.txParams.gas = txData.estimatedGas txData.txParams.gasLimit = txData.estimatedGas cb() }) -- cgit v1.2.3