aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-03-15 05:33:14 +0800
committerDan <danjm.com@gmail.com>2018-03-15 09:15:10 +0800
commitb0122be3c960b68620c5769ca969db60e4a45351 (patch)
treef393eb51831df4147932e08a14c8e803257b2d5b /ui
parent66422cd083e86582b44d19664e6c6fc95bdb8ce5 (diff)
downloadtangerine-wallet-browser-b0122be3c960b68620c5769ca969db60e4a45351.tar
tangerine-wallet-browser-b0122be3c960b68620c5769ca969db60e4a45351.tar.gz
tangerine-wallet-browser-b0122be3c960b68620c5769ca969db60e4a45351.tar.bz2
tangerine-wallet-browser-b0122be3c960b68620c5769ca969db60e4a45351.tar.lz
tangerine-wallet-browser-b0122be3c960b68620c5769ca969db60e4a45351.tar.xz
tangerine-wallet-browser-b0122be3c960b68620c5769ca969db60e4a45351.tar.zst
tangerine-wallet-browser-b0122be3c960b68620c5769ca969db60e4a45351.zip
Set retry gasPrice to forceGasMin on confirm screen in cases where gas is not edited.
Diffstat (limited to 'ui')
-rw-r--r--ui/app/components/pending-tx/confirm-send-ether.js19
-rw-r--r--ui/app/components/pending-tx/confirm-send-token.js19
2 files changed, 34 insertions, 4 deletions
diff --git a/ui/app/components/pending-tx/confirm-send-ether.js b/ui/app/components/pending-tx/confirm-send-ether.js
index dca39f0a5..a4763eab7 100644
--- a/ui/app/components/pending-tx/confirm-send-ether.js
+++ b/ui/app/components/pending-tx/confirm-send-ether.js
@@ -493,9 +493,24 @@ ConfirmSendEther.prototype.gatherTxMeta = function () {
const txData = clone(state.txData) || clone(props.txData)
const { gasPrice: sendGasPrice, gas: sendGasLimit } = props.send
- const { gasPrice: txGasPrice, gas: txGasLimit } = txData.txParams
+ const {
+ lastGasPrice,
+ txParams: {
+ gasPrice: txGasPrice,
+ gas: txGasLimit,
+ },
+ } = txData
+
+ let forceGasMin
+ if (lastGasPrice) {
+ forceGasMin = ethUtil.addHexPrefix(multiplyCurrencies(lastGasPrice, 1.1, {
+ multiplicandBase: 16,
+ multiplierBase: 10,
+ toNumericBase: 'hex',
+ }))
+ }
- txData.txParams.gasPrice = sendGasPrice || txGasPrice
+ txData.txParams.gasPrice = sendGasPrice || forceGasMin || txGasPrice
txData.txParams.gas = sendGasLimit || txGasLimit
// log.debug(`UI has defaulted to tx meta ${JSON.stringify(txData)}`)
diff --git a/ui/app/components/pending-tx/confirm-send-token.js b/ui/app/components/pending-tx/confirm-send-token.js
index 6035dd801..f1142b142 100644
--- a/ui/app/components/pending-tx/confirm-send-token.js
+++ b/ui/app/components/pending-tx/confirm-send-token.js
@@ -486,9 +486,24 @@ ConfirmSendToken.prototype.gatherTxMeta = function () {
const txData = clone(state.txData) || clone(props.txData)
const { gasPrice: sendGasPrice, gas: sendGasLimit } = props.send
- const { gasPrice: txGasPrice, gas: txGasLimit } = txData.txParams
+ const {
+ lastGasPrice,
+ txParams: {
+ gasPrice: txGasPrice,
+ gas: txGasLimit,
+ },
+ } = txData
+
+ let forceGasMin
+ if (lastGasPrice) {
+ forceGasMin = ethUtil.addHexPrefix(multiplyCurrencies(lastGasPrice, 1.1, {
+ multiplicandBase: 16,
+ multiplierBase: 10,
+ toNumericBase: 'hex',
+ }))
+ }
- txData.txParams.gasPrice = sendGasPrice || txGasPrice
+ txData.txParams.gasPrice = sendGasPrice || forceGasMin || txGasPrice
txData.txParams.gas = sendGasLimit || txGasLimit
// log.debug(`UI has defaulted to tx meta ${JSON.stringify(txData)}`)