1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

if an error happens during a tx publication set tx status to fail

This commit is contained in:
frankiebee 2017-07-06 22:30:25 -07:00
parent 47936019d2
commit 11b744bb87

View File

@ -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()