From b6b4be61d9f01f309b8f4ce708fa1220f84a5d8f Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 9 Nov 2016 16:29:24 -0800 Subject: [PATCH] Fix bug for increasing gas by 20 percent. --- CHANGELOG.md | 1 + app/scripts/lib/idStore.js | 2 ++ app/scripts/metamask-controller.js | 1 - 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6015ccb3..d0dbb5706 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## Current Master +- Fix bug where 20% of gas estimate was not being added properly. ## 2.13.7 2016-11-8 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() }) } diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 8b593d820..da05e5f5d 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -215,7 +215,6 @@ module.exports = class MetamaskController { let err = this.enforceTxValidations(txParams) if (err) return onTxDoneCb(err) - idStore.addUnconfirmedTransaction(txParams, onTxDoneCb, (err, txData) => { if (err) return onTxDoneCb(err) this.sendUpdate()