diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-12-07 12:42:47 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-12-07 12:42:47 +0800 |
commit | 0e25129028dd45d717d27dfe0c06db8a4052bd4e (patch) | |
tree | 42a9ddc13cf1d65786e12c7af4f86d7fc0b30f3e | |
parent | 31564e0a86072ae2b49923dcf28983075308c432 (diff) | |
download | tangerine-wallet-browser-0e25129028dd45d717d27dfe0c06db8a4052bd4e.tar tangerine-wallet-browser-0e25129028dd45d717d27dfe0c06db8a4052bd4e.tar.gz tangerine-wallet-browser-0e25129028dd45d717d27dfe0c06db8a4052bd4e.tar.bz2 tangerine-wallet-browser-0e25129028dd45d717d27dfe0c06db8a4052bd4e.tar.lz tangerine-wallet-browser-0e25129028dd45d717d27dfe0c06db8a4052bd4e.tar.xz tangerine-wallet-browser-0e25129028dd45d717d27dfe0c06db8a4052bd4e.tar.zst tangerine-wallet-browser-0e25129028dd45d717d27dfe0c06db8a4052bd4e.zip |
Enforce retry tx at minimum gas of previous tx
-rw-r--r-- | app/scripts/controllers/transactions.js | 5 | ||||
-rw-r--r-- | ui/app/components/pending-tx.js | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js index 67043b401..685db6269 100644 --- a/app/scripts/controllers/transactions.js +++ b/app/scripts/controllers/transactions.js @@ -185,7 +185,10 @@ module.exports = class TransactionController extends EventEmitter { } async retryTransaction (txId) { - return this.txStateManager.setTxStatusUnapproved(txId) + this.txStateManager.setTxStatusUnapproved(txId) + const txMeta = this.txStateManager.getTx(txId) + txMeta.lastGasPrice = txMeta.txParams.gasPrice + this.txStateManager.updateTx(txMeta, 'retryTransaction: manual retry') } async updateAndApproveTransaction (txMeta) { diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js index 5b1b367c6..51e57dcd2 100644 --- a/ui/app/components/pending-tx.js +++ b/ui/app/components/pending-tx.js @@ -38,6 +38,14 @@ PendingTx.prototype.render = function () { const txMeta = this.gatherTxMeta() const txParams = txMeta.txParams || {} + // Allow retry txs + const { lastGasPrice } = txMeta + let forceGasMin + if (lastGasPrice) { + const stripped = ethUtil.stripHexPrefix(lastGasPrice) + forceGasMin = new BN(stripped, 16).add(MIN_GAS_PRICE_BN) + } + // Account Details const address = txParams.from || props.selectedAddress const identity = props.identities[address] || { address: address } @@ -199,7 +207,7 @@ PendingTx.prototype.render = function () { precision: 9, scale: 9, suffix: 'GWEI', - min: MIN_GAS_PRICE_BN, + min: forceGasMin || MIN_GAS_PRICE_BN, style: { position: 'relative', top: '5px', |