diff options
author | kumavis <kumavis@users.noreply.github.com> | 2017-10-19 06:09:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-19 06:09:32 +0800 |
commit | 8da0d0b28a52d476da3623774159e8d6a595da2d (patch) | |
tree | d35cd3391ca2dda9626f6076cbff1e3da0e02c97 /app/scripts/lib/nonce-tracker.js | |
parent | 5eeb1440468cb77111fd09d01b85b4b9a5264766 (diff) | |
download | tangerine-wallet-browser-8da0d0b28a52d476da3623774159e8d6a595da2d.tar tangerine-wallet-browser-8da0d0b28a52d476da3623774159e8d6a595da2d.tar.gz tangerine-wallet-browser-8da0d0b28a52d476da3623774159e8d6a595da2d.tar.bz2 tangerine-wallet-browser-8da0d0b28a52d476da3623774159e8d6a595da2d.tar.lz tangerine-wallet-browser-8da0d0b28a52d476da3623774159e8d6a595da2d.tar.xz tangerine-wallet-browser-8da0d0b28a52d476da3623774159e8d6a595da2d.tar.zst tangerine-wallet-browser-8da0d0b28a52d476da3623774159e8d6a595da2d.zip |
Revert "NetworkController refactor for new EthClient interface"
Diffstat (limited to 'app/scripts/lib/nonce-tracker.js')
-rw-r--r-- | app/scripts/lib/nonce-tracker.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/scripts/lib/nonce-tracker.js b/app/scripts/lib/nonce-tracker.js index 2af40a27f..0029ac953 100644 --- a/app/scripts/lib/nonce-tracker.js +++ b/app/scripts/lib/nonce-tracker.js @@ -4,9 +4,8 @@ const Mutex = require('await-semaphore').Mutex class NonceTracker { - constructor ({ provider, blockTracker, getPendingTransactions, getConfirmedTransactions }) { + constructor ({ provider, getPendingTransactions, getConfirmedTransactions }) { this.provider = provider - this.blockTracker = blockTracker this.ethQuery = new EthQuery(provider) this.getPendingTransactions = getPendingTransactions this.getConfirmedTransactions = getConfirmedTransactions @@ -54,7 +53,7 @@ class NonceTracker { } async _getCurrentBlock () { - const blockTracker = this.blockTracker + const blockTracker = this._getBlockTracker() const currentBlock = blockTracker.getCurrentBlock() if (currentBlock) return currentBlock return await Promise((reject, resolve) => { @@ -140,6 +139,11 @@ class NonceTracker { return { name: 'local', nonce: highest, details: { startPoint, highest } } } + // this is a hotfix for the fact that the blockTracker will + // change when the network changes + _getBlockTracker () { + return this.provider._blockTracker + } } module.exports = NonceTracker |