aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-07-27 06:32:19 +0800
committerDan Finlay <dan@danfinlay.com>2017-07-27 06:32:19 +0800
commitf147b928b238af3e1f0abdcc4d38b5281f67aba4 (patch)
tree758d3cb81d42af5bde01be3dbedfb24536cc1a80 /app
parent3d8ebf2265d167923f3b913bac3b9cc4d37fa052 (diff)
parent520cda0058849778461cf6b9682980068149c120 (diff)
downloadtangerine-wallet-browser-f147b928b238af3e1f0abdcc4d38b5281f67aba4.tar
tangerine-wallet-browser-f147b928b238af3e1f0abdcc4d38b5281f67aba4.tar.gz
tangerine-wallet-browser-f147b928b238af3e1f0abdcc4d38b5281f67aba4.tar.bz2
tangerine-wallet-browser-f147b928b238af3e1f0abdcc4d38b5281f67aba4.tar.lz
tangerine-wallet-browser-f147b928b238af3e1f0abdcc4d38b5281f67aba4.tar.xz
tangerine-wallet-browser-f147b928b238af3e1f0abdcc4d38b5281f67aba4.tar.zst
tangerine-wallet-browser-f147b928b238af3e1f0abdcc4d38b5281f67aba4.zip
Merge branch 'master' into i1805-LiveBlacklistUpdating
Diffstat (limited to 'app')
-rw-r--r--app/manifest.json2
-rw-r--r--app/scripts/controllers/transactions.js1
-rw-r--r--app/scripts/lib/nonce-tracker.js17
3 files changed, 13 insertions, 7 deletions
diff --git a/app/manifest.json b/app/manifest.json
index eadd99590..55e1eb5b1 100644
--- a/app/manifest.json
+++ b/app/manifest.json
@@ -1,7 +1,7 @@
{
"name": "MetaMask",
"short_name": "Metamask",
- "version": "3.9.1",
+ "version": "3.9.2",
"manifest_version": 2,
"author": "https://metamask.io",
"description": "Ethereum Browser Extension",
diff --git a/app/scripts/controllers/transactions.js b/app/scripts/controllers/transactions.js
index 8f53ffa8c..f71659042 100644
--- a/app/scripts/controllers/transactions.js
+++ b/app/scripts/controllers/transactions.js
@@ -24,7 +24,6 @@ module.exports = class TransactionController extends EventEmitter {
this.blockTracker = opts.blockTracker
this.nonceTracker = new NonceTracker({
provider: this.provider,
- blockTracker: this.provider._blockTracker,
getPendingTransactions: (address) => {
return this.getFilteredTxList({
from: address,
diff --git a/app/scripts/lib/nonce-tracker.js b/app/scripts/lib/nonce-tracker.js
index c0746bd87..8328e81ec 100644
--- a/app/scripts/lib/nonce-tracker.js
+++ b/app/scripts/lib/nonce-tracker.js
@@ -4,8 +4,8 @@ const Mutex = require('await-semaphore').Mutex
class NonceTracker {
- constructor ({ blockTracker, provider, getPendingTransactions }) {
- this.blockTracker = blockTracker
+ constructor ({ provider, getPendingTransactions }) {
+ this.provider = provider
this.ethQuery = new EthQuery(provider)
this.getPendingTransactions = getPendingTransactions
this.lockMap = {}
@@ -39,16 +39,17 @@ class NonceTracker {
assert(Number.isInteger(nextNonce), `nonce-tracker - nextNonce is not an integer - got: (${typeof nextNonce}) "${nextNonce}"`)
// collect the numbers used to calculate the nonce for debugging
const blockNumber = currentBlock.number
- const nonceDetails = { blockNumber, baseCount, pendingCount }
+ const nonceDetails = { blockNumber, baseCount, baseCountHex, pendingCount }
// return nonce and release cb
return { nextNonce, nonceDetails, releaseLock }
}
async _getCurrentBlock () {
- const currentBlock = this.blockTracker.getCurrentBlock()
+ const blockTracker = this._getBlockTracker()
+ const currentBlock = blockTracker.getCurrentBlock()
if (currentBlock) return currentBlock
return await Promise((reject, resolve) => {
- this.blockTracker.once('latest', resolve)
+ blockTracker.once('latest', resolve)
})
}
@@ -82,6 +83,12 @@ class NonceTracker {
return mutex
}
+ // this is a hotfix for the fact that the blockTracker will
+ // change when the network changes
+ _getBlockTracker () {
+ return this.provider._blockTracker
+ }
+
}
module.exports = NonceTracker