aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers/transactions/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/controllers/transactions/index.js')
-rw-r--r--app/scripts/controllers/transactions/index.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/scripts/controllers/transactions/index.js b/app/scripts/controllers/transactions/index.js
index 1dd410d2c..9cd8429fb 100644
--- a/app/scripts/controllers/transactions/index.js
+++ b/app/scripts/controllers/transactions/index.js
@@ -96,7 +96,10 @@ class TransactionController extends EventEmitter {
// memstore is computed from a few different stores
this._updateMemstore()
this.txStateManager.store.subscribe(() => this._updateMemstore())
- this.networkStore.subscribe(() => this._updateMemstore())
+ this.networkStore.subscribe(() => {
+ this._onBootCleanUp()
+ this._updateMemstore()
+ })
this.preferencesStore.subscribe(() => this._updateMemstore())
// request state update to finalize initialization
@@ -191,10 +194,13 @@ class TransactionController extends EventEmitter {
txMeta = await this.addTxGasDefaults(txMeta)
} catch (error) {
log.warn(error)
- this.txStateManager.setTxStatusFailed(txMeta.id, error)
+ txMeta.loadingDefaults = false
+ this.txStateManager.updateTx(txMeta, 'Failed to calculate gas defaults.')
throw error
}
+
txMeta.loadingDefaults = false
+
// save txMeta
this.txStateManager.updateTx(txMeta)
@@ -485,6 +491,8 @@ class TransactionController extends EventEmitter {
txMeta.loadingDefaults = false
this.txStateManager.updateTx(txMeta, 'transactions: gas estimation for tx on boot')
}).catch((error) => {
+ tx.loadingDefaults = false
+ this.txStateManager.updateTx(tx, 'failed to estimate gas during boot cleanup.')
this.txStateManager.setTxStatusFailed(tx.id, error)
})
})