Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Vivek's bug #5860

Merged
merged 4 commits into from
Nov 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions app/scripts/controllers/transactions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
})
})
Expand Down