From 11d57adc5c6fa124cbb83a907a55a0aa733bb1cc Mon Sep 17 00:00:00 2001 From: frankiebee Date: Tue, 11 Jul 2017 11:57:42 -0700 Subject: add "Gateway timeout" to ignored errors when resubmiting and use .includes over .startsWith --- app/scripts/controllers/transactions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js index 18bb245de..933c079d2 100644 --- a/app/scripts/controllers/transactions.js +++ b/app/scripts/controllers/transactions.js @@ -427,10 +427,12 @@ module.exports = class TransactionController extends EventEmitter { const isKnownTx = ( // geth errorMessage === 'replacement transaction underpriced' - || errorMessage.startsWith('known transaction') + || errorMessage.includes('known transaction') // parity || errorMessage === 'gas price too low to replace' || errorMessage === 'transaction with the same hash was already imported.' + // other + || errorMessage.includes('gateway timeout') ) // ignore resubmit warnings, return early if (isKnownTx) return -- cgit v1.2.3 From 611338c4e0b6de670f1a3ac6a0f1ddd3a2c063f7 Mon Sep 17 00:00:00 2001 From: frankiebee Date: Tue, 11 Jul 2017 12:01:59 -0700 Subject: use .includes --- app/scripts/controllers/transactions.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js index 933c079d2..c0d4841a9 100644 --- a/app/scripts/controllers/transactions.js +++ b/app/scripts/controllers/transactions.js @@ -426,11 +426,11 @@ module.exports = class TransactionController extends EventEmitter { const errorMessage = err.message.toLowerCase() const isKnownTx = ( // geth - errorMessage === 'replacement transaction underpriced' + errorMessage.includes('replacement transaction underpriced') || errorMessage.includes('known transaction') // parity - || errorMessage === 'gas price too low to replace' - || errorMessage === 'transaction with the same hash was already imported.' + || errorMessage.includes('gas price too low to replace') + || errorMessage.includes('transaction with the same hash was already imported') // other || errorMessage.includes('gateway timeout') ) -- cgit v1.2.3