aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-07-12 03:18:07 +0800
committerDan Finlay <dan@danfinlay.com>2017-07-12 03:19:01 +0800
commitc7b9e3fb1878cebbab26d5343cc18084a601c6bb (patch)
tree1afe10a7c6f4107486ea32ee72323c75dec707a2 /app/scripts/controllers
parentd97c6533b87b0a9dd6937c1ca57ec05129ac619b (diff)
downloadtangerine-wallet-browser-c7b9e3fb1878cebbab26d5343cc18084a601c6bb.tar.gz
tangerine-wallet-browser-c7b9e3fb1878cebbab26d5343cc18084a601c6bb.tar.zst
tangerine-wallet-browser-c7b9e3fb1878cebbab26d5343cc18084a601c6bb.zip
Improve insufficient balance checking in retry loop
Diffstat (limited to 'app/scripts/controllers')
-rw-r--r--app/scripts/controllers/transactions.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js
index 02487c385..ca379a7ff 100644
--- a/app/scripts/controllers/transactions.js
+++ b/app/scripts/controllers/transactions.js
@@ -445,13 +445,10 @@ module.exports = class TransactionController extends EventEmitter {
_resubmitTx (txMeta, cb) {
const address = txMeta.txParams.from
const balance = this.ethStore.getState().accounts[address].balance
- const nonce = Number.parseInt(this.ethStore.getState().accounts[address].nonce)
- const txNonce = Number.parseInt(txMeta.txParams.nonce)
- const gtBalance = Number.parseInt(txMeta.txParams.value) > Number.parseInt(balance)
if (!('retryCount' in txMeta)) txMeta.retryCount = 0
// if the value of the transaction is greater then the balance, fail.
- if (gtBalance) {
+ if (!this.txProviderUtils.sufficientBalance(txMeta.txParams, balance)) {
const message = 'Insufficient balance.'
this.setTxStatusFailed(txMeta.id, { message })
cb()