aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/metamask-controller.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2018-01-12 07:00:48 +0800
committerDan Finlay <dan@danfinlay.com>2018-01-12 07:04:54 +0800
commit4a9dad7c40b97f1e625931d6b57fc9d7fdc5080d (patch)
tree5da6f5480adebd94f4df3ca24c07e35dc56f7298 /app/scripts/metamask-controller.js
parent89f75a3a3bde50e583688559e7f876062d2fcdcb (diff)
downloadtangerine-wallet-browser-4a9dad7c40b97f1e625931d6b57fc9d7fdc5080d.tar
tangerine-wallet-browser-4a9dad7c40b97f1e625931d6b57fc9d7fdc5080d.tar.gz
tangerine-wallet-browser-4a9dad7c40b97f1e625931d6b57fc9d7fdc5080d.tar.bz2
tangerine-wallet-browser-4a9dad7c40b97f1e625931d6b57fc9d7fdc5080d.tar.lz
tangerine-wallet-browser-4a9dad7c40b97f1e625931d6b57fc9d7fdc5080d.tar.xz
tangerine-wallet-browser-4a9dad7c40b97f1e625931d6b57fc9d7fdc5080d.tar.zst
tangerine-wallet-browser-4a9dad7c40b97f1e625931d6b57fc9d7fdc5080d.zip
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.js6
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,