aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorKevin Serrano <kevin.serrano@consensys.net>2017-09-21 00:40:33 +0800
committerKevin Serrano <kevin.serrano@consensys.net>2017-09-21 00:40:33 +0800
commitb22783a223e84e541db9c1e2d411ef27f62d7e62 (patch)
tree6ad0809ed79a0e1aa7e5934616779168324ec143 /app/scripts
parentbd8428e9ed3e1fb386620def0739720aa8985299 (diff)
parent9bd55f4897938bfdc363987252be6f5f390ab7a5 (diff)
downloadtangerine-wallet-browser-b22783a223e84e541db9c1e2d411ef27f62d7e62.tar
tangerine-wallet-browser-b22783a223e84e541db9c1e2d411ef27f62d7e62.tar.gz
tangerine-wallet-browser-b22783a223e84e541db9c1e2d411ef27f62d7e62.tar.bz2
tangerine-wallet-browser-b22783a223e84e541db9c1e2d411ef27f62d7e62.tar.lz
tangerine-wallet-browser-b22783a223e84e541db9c1e2d411ef27f62d7e62.tar.xz
tangerine-wallet-browser-b22783a223e84e541db9c1e2d411ef27f62d7e62.tar.zst
tangerine-wallet-browser-b22783a223e84e541db9c1e2d411ef27f62d7e62.zip
Merge branch 'master' into new-currency-test
Diffstat (limited to 'app/scripts')
-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) {