aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrankiebee <frankie.diamond@gmail.com>2017-07-07 13:30:25 +0800
committerfrankiebee <frankie.diamond@gmail.com>2017-07-07 13:30:25 +0800
commit11b744bb87b4858dd2ef982c7d27e9751d8a09a1 (patch)
treea375d9a2b5f382d8e3aca5233ea4d1b387d249fa
parent47936019d237f3603e14508ea76922fabb4ca0aa (diff)
downloadtangerine-wallet-browser-11b744bb87b4858dd2ef982c7d27e9751d8a09a1.tar
tangerine-wallet-browser-11b744bb87b4858dd2ef982c7d27e9751d8a09a1.tar.gz
tangerine-wallet-browser-11b744bb87b4858dd2ef982c7d27e9751d8a09a1.tar.bz2
tangerine-wallet-browser-11b744bb87b4858dd2ef982c7d27e9751d8a09a1.tar.lz
tangerine-wallet-browser-11b744bb87b4858dd2ef982c7d27e9751d8a09a1.tar.xz
tangerine-wallet-browser-11b744bb87b4858dd2ef982c7d27e9751d8a09a1.tar.zst
tangerine-wallet-browser-11b744bb87b4858dd2ef982c7d27e9751d8a09a1.zip
if an error happens during a tx publication set tx status to fail
-rw-r--r--app/scripts/controllers/transactions.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js
index 7946d10d1..8d3445c6f 100644
--- a/app/scripts/controllers/transactions.js
+++ b/app/scripts/controllers/transactions.js
@@ -240,7 +240,16 @@ module.exports = class TransactionController extends EventEmitter {
this.updateTx(txMeta)
this.txProviderUtils.publishTransaction(rawTx, (err, txHash) => {
- if (err) return cb(err)
+ if (err) {
+ const errorMessage = err.message.toLowerCase()
+ if (errorMessage !== 'replacement transaction underpriced'
+ && errorMessage !== 'gas price too low to replace'
+ && !errorMessage.startsWith('known transaction')
+ ) {
+ this.setTxStatusFailed(txId)
+ }
+ return cb(err)
+ }
this.setTxHash(txId, txHash)
this.setTxStatusSubmitted(txId)
cb()