diff options
Improve gas price estimation by backfilling recent-blocks
When first initializing, recent-block controller now back-fills up to
its desired history length. This makes estimated gas prices reflect a
longer recent history, even when first switching to a new network.
Fixes #2925
Diffstat (limited to 'app/scripts/metamask-controller.js')
-rw-r--r-- | app/scripts/metamask-controller.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index f62b5e5cd..81d70797a 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -94,12 +94,14 @@ module.exports = class MetamaskController extends EventEmitter { this.provider = this.initializeProvider() this.blockTracker = this.provider._blockTracker + // eth data query tools + this.ethQuery = new EthQuery(this.provider) + this.recentBlocksController = new RecentBlocksController({ blockTracker: this.blockTracker, + ethQuery: this.ethQuery, }) - // eth data query tools - this.ethQuery = new EthQuery(this.provider) // account tracker watches balances, nonces, and any code at their address. this.accountTracker = new AccountTracker({ provider: this.provider, |