diff options
author | Dan Finlay <542863+danfinlay@users.noreply.github.com> | 2017-10-06 03:34:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-06 03:34:56 +0800 |
commit | 833d73da566f5d5d379f594c309318bab6eadbfb (patch) | |
tree | b9a52ea4ca362d79b3f515e3eae78c59ded077f6 /app/scripts/lib | |
parent | c880d81ec3bfcd4d46c5d454cf9828adff15a0f5 (diff) | |
parent | 554a3ac4e4f4493f318753410bb4332204f2efb7 (diff) | |
download | tangerine-wallet-browser-833d73da566f5d5d379f594c309318bab6eadbfb.tar tangerine-wallet-browser-833d73da566f5d5d379f594c309318bab6eadbfb.tar.gz tangerine-wallet-browser-833d73da566f5d5d379f594c309318bab6eadbfb.tar.bz2 tangerine-wallet-browser-833d73da566f5d5d379f594c309318bab6eadbfb.tar.lz tangerine-wallet-browser-833d73da566f5d5d379f594c309318bab6eadbfb.tar.xz tangerine-wallet-browser-833d73da566f5d5d379f594c309318bab6eadbfb.tar.zst tangerine-wallet-browser-833d73da566f5d5d379f594c309318bab6eadbfb.zip |
Merge pull request #2292 from MetaMask/rebrocast-by-timeStamp
Rebrocast by time stamp
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/pending-tx-tracker.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/scripts/lib/pending-tx-tracker.js b/app/scripts/lib/pending-tx-tracker.js index 6f1601586..8a626e222 100644 --- a/app/scripts/lib/pending-tx-tracker.js +++ b/app/scripts/lib/pending-tx-tracker.js @@ -22,7 +22,8 @@ module.exports = class PendingTransactionTracker extends EventEmitter { super() this.query = new EthQuery(config.provider) this.nonceTracker = config.nonceTracker - this.retryLimit = config.retryLimit || Infinity + // default is one day + this.retryTimePeriod = config.retryTimePeriod || 86400000 this.getPendingTransactions = config.getPendingTransactions this.publishTransaction = config.publishTransaction } @@ -99,8 +100,9 @@ module.exports = class PendingTransactionTracker extends EventEmitter { } async _resubmitTx (txMeta) { - if (txMeta.retryCount > this.retryLimit) { - const err = new Error(`Gave up submitting after ${this.retryLimit} blocks un-mined.`) + if (Date.now() > txMeta.time + this.retryTimePeriod) { + const hours = (this.retryTimePeriod / 3.6e+6).toFixed(1) + const err = new Error(`Gave up submitting after ${hours} hours.`) return this.emit('tx:failed', txMeta.id, err) } |