diff options
author | Kevin Serrano <kevin.serrano@consensys.net> | 2017-10-06 08:06:55 +0800 |
---|---|---|
committer | Kevin Serrano <kevin.serrano@consensys.net> | 2017-10-06 08:06:55 +0800 |
commit | b9012a62e5df372a9cd5309e345b5f5ff0230e38 (patch) | |
tree | 553578318e7e067bdb619abb346957ab48e377b7 /app | |
parent | bb9c2b3563938832e4b35b6623ef724017093fcb (diff) | |
parent | 53da368d2370edbb78eca063ff701c0492abbff6 (diff) | |
download | tangerine-wallet-browser-b9012a62e5df372a9cd5309e345b5f5ff0230e38.tar tangerine-wallet-browser-b9012a62e5df372a9cd5309e345b5f5ff0230e38.tar.gz tangerine-wallet-browser-b9012a62e5df372a9cd5309e345b5f5ff0230e38.tar.bz2 tangerine-wallet-browser-b9012a62e5df372a9cd5309e345b5f5ff0230e38.tar.lz tangerine-wallet-browser-b9012a62e5df372a9cd5309e345b5f5ff0230e38.tar.xz tangerine-wallet-browser-b9012a62e5df372a9cd5309e345b5f5ff0230e38.tar.zst tangerine-wallet-browser-b9012a62e5df372a9cd5309e345b5f5ff0230e38.zip |
Merge branch 'master' into version-debugging
Diffstat (limited to 'app')
-rw-r--r-- | app/manifest.json | 2 | ||||
-rw-r--r-- | app/scripts/controllers/transactions.js | 2 | ||||
-rw-r--r-- | app/scripts/lib/pending-tx-tracker.js | 8 |
3 files changed, 7 insertions, 5 deletions
diff --git a/app/manifest.json b/app/manifest.json index 0fc43c7d4..c253a5c2b 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "MetaMask", "short_name": "Metamask", - "version": "3.10.8", + "version": "3.10.9", "manifest_version": 2, "author": "https://metamask.io", "description": "Ethereum Browser Extension", diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js index 94e04c429..a0f983deb 100644 --- a/app/scripts/controllers/transactions.js +++ b/app/scripts/controllers/transactions.js @@ -59,7 +59,7 @@ module.exports = class TransactionController extends EventEmitter { this.pendingTxTracker = new PendingTransactionTracker({ provider: this.provider, nonceTracker: this.nonceTracker, - retryLimit: 3500, // Retry 3500 blocks, or about 1 day. + retryTimePeriod: 86400000, // Retry 3500 blocks, or about 1 day. publishTransaction: (rawTx) => this.query.sendRawTransaction(rawTx), getPendingTransactions: this.txStateManager.getPendingTransactions.bind(this.txStateManager), }) 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) } |