aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/pending-tx-tracker.js
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-09-20 02:27:49 +0800
committerkumavis <aaron@kumavis.me>2017-09-20 02:27:49 +0800
commit77e02d264ad65cacd6a3c4f0087bd5e2c375ef4c (patch)
treed11ce4e1e314a9fe5018737eae17b68316b60a13 /app/scripts/lib/pending-tx-tracker.js
parentb979c6a2f3856525faaff0de94a3e97e322d18b6 (diff)
parent166bd55a43125796521f7caf97c2e2baf3519b36 (diff)
downloadtangerine-wallet-browser-77e02d264ad65cacd6a3c4f0087bd5e2c375ef4c.tar
tangerine-wallet-browser-77e02d264ad65cacd6a3c4f0087bd5e2c375ef4c.tar.gz
tangerine-wallet-browser-77e02d264ad65cacd6a3c4f0087bd5e2c375ef4c.tar.bz2
tangerine-wallet-browser-77e02d264ad65cacd6a3c4f0087bd5e2c375ef4c.tar.lz
tangerine-wallet-browser-77e02d264ad65cacd6a3c4f0087bd5e2c375ef4c.tar.xz
tangerine-wallet-browser-77e02d264ad65cacd6a3c4f0087bd5e2c375ef4c.tar.zst
tangerine-wallet-browser-77e02d264ad65cacd6a3c4f0087bd5e2c375ef4c.zip
Merge branch 'master' of github.com:MetaMask/metamask-plugin into json-rpc-engine-bump
Diffstat (limited to 'app/scripts/lib/pending-tx-tracker.js')
-rw-r--r--app/scripts/lib/pending-tx-tracker.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/scripts/lib/pending-tx-tracker.js b/app/scripts/lib/pending-tx-tracker.js
index b90851b58..44e9d50fa 100644
--- a/app/scripts/lib/pending-tx-tracker.js
+++ b/app/scripts/lib/pending-tx-tracker.js
@@ -76,6 +76,9 @@ module.exports = class PendingTransactionTracker extends EventEmitter {
Dont marked as failed if the error is a "known" transaction warning
"there is already a transaction with the same sender-nonce
but higher/same gas price"
+
+ Also don't mark as failed if it has ever been broadcast successfully.
+ A successful broadcast means it may still be mined.
*/
const errorMessage = err.message.toLowerCase()
const isKnownTx = (
@@ -88,6 +91,7 @@ module.exports = class PendingTransactionTracker extends EventEmitter {
// other
|| errorMessage.includes('gateway timeout')
|| errorMessage.includes('nonce too low')
+ || txMeta.retryCount > 1
)
// ignore resubmit warnings, return early
if (isKnownTx) return
@@ -117,10 +121,12 @@ module.exports = class PendingTransactionTracker extends EventEmitter {
// Only auto-submit already-signed txs:
if (!('rawTx' in txMeta)) return
- // Increment a try counter.
- txMeta.retryCount++
const rawTx = txMeta.rawTx
- return await this.publishTransaction(rawTx)
+ const txHash = await this.publishTransaction(rawTx)
+
+ // Increment successful tries:
+ txMeta.retryCount++
+ return txHash
}
async _checkPendingTx (txMeta) {