aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-06-15 03:01:45 +0800
committerDan Finlay <dan@danfinlay.com>2017-06-15 03:01:45 +0800
commit0fd32e67d4c8e911cd5cd88b81f04d11b2202609 (patch)
tree49c56d257358bfdada605a2f6d91927b37a27a2d
parent1a4f982739a09a4fd757b5f45fcaeef1a93dd4a3 (diff)
downloadtangerine-wallet-browser-0fd32e67d4c8e911cd5cd88b81f04d11b2202609.tar
tangerine-wallet-browser-0fd32e67d4c8e911cd5cd88b81f04d11b2202609.tar.gz
tangerine-wallet-browser-0fd32e67d4c8e911cd5cd88b81f04d11b2202609.tar.bz2
tangerine-wallet-browser-0fd32e67d4c8e911cd5cd88b81f04d11b2202609.tar.lz
tangerine-wallet-browser-0fd32e67d4c8e911cd5cd88b81f04d11b2202609.tar.xz
tangerine-wallet-browser-0fd32e67d4c8e911cd5cd88b81f04d11b2202609.tar.zst
tangerine-wallet-browser-0fd32e67d4c8e911cd5cd88b81f04d11b2202609.zip
Do not mark slowly mined txs as failed.
Fixes #1567 Also seems to fix #1556 Also improves resubmit performance by only resubmitting on `latest`.
-rw-r--r--CHANGELOG.md1
-rw-r--r--app/scripts/controllers/transactions.js12
2 files changed, 5 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7f99e680e..0d3e86342 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@
## Current Master
- Add a warning to JSON file import.
+- Fix bug where slowly mined txs would sometimes be incorrectly marked as failed.
## 3.7.8 2017-6-12
diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js
index 2db8041eb..931f01855 100644
--- a/app/scripts/controllers/transactions.js
+++ b/app/scripts/controllers/transactions.js
@@ -25,7 +25,7 @@ module.exports = class TransactionController extends EventEmitter {
this.query = opts.ethQuery
this.txProviderUtils = new TxProviderUtil(this.query)
this.blockTracker.on('block', this.checkForTxInBlock.bind(this))
- this.blockTracker.on('block', this.resubmitPendingTxs.bind(this))
+ this.blockTracker.on('latest', this.resubmitPendingTxs.bind(this))
this.signEthTx = opts.signTransaction
this.nonceLock = Semaphore(1)
@@ -339,7 +339,7 @@ module.exports = class TransactionController extends EventEmitter {
// checks if a signed tx is in a block and
// if included sets the tx status as 'confirmed'
checkForTxInBlock () {
- var signedTxList = this.getFilteredTxList({status: 'submitted'})
+ var signedTxList = this.getFilteredTxList({ status: 'submitted' })
if (!signedTxList.length) return
signedTxList.forEach((txMeta) => {
var txHash = txMeta.hash
@@ -430,12 +430,8 @@ module.exports = class TransactionController extends EventEmitter {
}
if (txMeta.retryCount > RETRY_LIMIT) {
- txMeta.err = {
- isWarning: true,
- message: 'Gave up submitting tx.',
- }
- this.updateTx(txMeta)
- return log.error(txMeta.err.message)
+ const message = 'Gave up submitting tx ' + txMeta.hash
+ return log.warning(message)
}
txMeta.retryCount++