diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2017-09-19 09:13:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-19 09:13:15 +0800 |
commit | a67d3ecd46ac2b9932d1a4181bb76631b27629c2 (patch) | |
tree | d96b262074f506a1a7a48975dbf85e1374207851 /app/scripts | |
parent | 190330db921d5549a3e4363308545fb702e0089c (diff) | |
parent | 7094d965291fa19f96145d122cb9f0f76da053c0 (diff) | |
download | tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar.gz tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar.bz2 tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar.lz tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar.xz tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.tar.zst tangerine-wallet-browser-a67d3ecd46ac2b9932d1a4181bb76631b27629c2.zip |
Merge branch 'master' into NewUI-flat
Diffstat (limited to 'app/scripts')
-rw-r--r-- | app/scripts/lib/pending-tx-tracker.js | 12 |
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) { |