aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2017-12-06 04:51:14 +0800
committerDan <danjm.com@gmail.com>2017-12-06 04:51:14 +0800
commitae2a4d78e8c7733da1963965e38e154351d54a20 (patch)
tree29db56b4949caec647c3fa38a5678f8e5bdf974e /app/scripts/controllers
parentc30b543a8069c3925bb254716699752e38eaf97a (diff)
downloadtangerine-wallet-browser-ae2a4d78e8c7733da1963965e38e154351d54a20.tar
tangerine-wallet-browser-ae2a4d78e8c7733da1963965e38e154351d54a20.tar.gz
tangerine-wallet-browser-ae2a4d78e8c7733da1963965e38e154351d54a20.tar.bz2
tangerine-wallet-browser-ae2a4d78e8c7733da1963965e38e154351d54a20.tar.lz
tangerine-wallet-browser-ae2a4d78e8c7733da1963965e38e154351d54a20.tar.xz
tangerine-wallet-browser-ae2a4d78e8c7733da1963965e38e154351d54a20.tar.zst
tangerine-wallet-browser-ae2a4d78e8c7733da1963965e38e154351d54a20.zip
Exponentional backoff on transaction retry in pending-tx-tracker
Diffstat (limited to 'app/scripts/controllers')
-rw-r--r--app/scripts/controllers/transactions.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js
index a861c0342..063ba8f65 100644
--- a/app/scripts/controllers/transactions.js
+++ b/app/scripts/controllers/transactions.js
@@ -72,6 +72,12 @@ module.exports = class TransactionController extends EventEmitter {
})
this.pendingTxTracker.on('tx:failed', this.txStateManager.setTxStatusFailed.bind(this.txStateManager))
this.pendingTxTracker.on('tx:confirmed', this.txStateManager.setTxStatusConfirmed.bind(this.txStateManager))
+ this.pendingTxTracker.on('tx:block-update', (txMeta, latestBlockNumber) => {
+ if (!txMeta.firstRetryBlockNumber) {
+ txMeta.firstRetryBlockNumber = latestBlockNumber
+ this.txStateManager.updateTx(txMeta, 'transactions/pending-tx-tracker#event: tx:retry')
+ }
+ })
this.pendingTxTracker.on('tx:retry', (txMeta) => {
if (!('retryCount' in txMeta)) txMeta.retryCount = 0
txMeta.retryCount++