|
|
|
@ -83,7 +83,11 @@ class TransactionController extends EventEmitter { |
|
|
|
|
this.txStateManager.store.subscribe(() => this._updateMemstore()) |
|
|
|
|
this.networkStore.subscribe(() => this._updateMemstore()) |
|
|
|
|
this.preferencesStore.subscribe(() => this._updateMemstore()) |
|
|
|
|
|
|
|
|
|
// request state update to finalize initialization
|
|
|
|
|
this._updatePendingTxsAfterFirstBlock() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** @returns {number} the chainId*/ |
|
|
|
|
getChainId () { |
|
|
|
|
const networkState = this.networkStore.getState() |
|
|
|
@ -349,6 +353,14 @@ class TransactionController extends EventEmitter { |
|
|
|
|
this.getFilteredTxList = (opts) => this.txStateManager.getFilteredTxList(opts) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// called once on startup
|
|
|
|
|
async _updatePendingTxsAfterFirstBlock () { |
|
|
|
|
// wait for first block so we know we're ready
|
|
|
|
|
await this.blockTracker.getLatestBlock() |
|
|
|
|
// get status update for all pending transactions (for the current network)
|
|
|
|
|
await this.pendingTxTracker.updatePendingTxs() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
If transaction controller was rebooted with transactions that are uncompleted |
|
|
|
|
in steps of the transaction signing or user confirmation process it will either |
|
|
|
|