aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrankie <frankie.diamond@gmail.com>2017-09-19 05:42:55 +0800
committerGitHub <noreply@github.com>2017-09-19 05:42:55 +0800
commit7094d965291fa19f96145d122cb9f0f76da053c0 (patch)
tree081dfb43608a8097c382b68a2516139820a4036e
parent6204afb156dd5d8c06d5e79b77dcc5f3b2f3e46b (diff)
parent92e738d17c71d43487b4037df766453d6d8c9273 (diff)
downloadtangerine-wallet-browser-7094d965291fa19f96145d122cb9f0f76da053c0.tar
tangerine-wallet-browser-7094d965291fa19f96145d122cb9f0f76da053c0.tar.gz
tangerine-wallet-browser-7094d965291fa19f96145d122cb9f0f76da053c0.tar.bz2
tangerine-wallet-browser-7094d965291fa19f96145d122cb9f0f76da053c0.tar.lz
tangerine-wallet-browser-7094d965291fa19f96145d122cb9f0f76da053c0.tar.xz
tangerine-wallet-browser-7094d965291fa19f96145d122cb9f0f76da053c0.tar.zst
tangerine-wallet-browser-7094d965291fa19f96145d122cb9f0f76da053c0.zip
Merge pull request #2121 from MetaMask/i2115-DoNotFailOnRetriesv3.10.2
Do not mark a retry tx failed that has been broadcast successfully
-rw-r--r--CHANGELOG.md2
-rw-r--r--app/scripts/lib/pending-tx-tracker.js12
2 files changed, 11 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5ef0ce17a..464cbe43c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,8 @@
## Current Master
+- Fix bug that would sometimes display transactions as failed that could be successfully mined.
+
## 3.10.1 2017-9-18
- Add ability to export private keys as a file.
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) {