aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/nonce-tracker.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-10-13 00:59:28 +0800
committerDan Finlay <dan@danfinlay.com>2017-10-13 01:25:19 +0800
commitd0d082d70c1e256aeb70f90fcdc864aeca00aed4 (patch)
treea487d9bb888eebeba9c68d570cc55a5541384451 /app/scripts/lib/nonce-tracker.js
parent1cba6543a42561c6691736d58f45e97f4832912b (diff)
parent29ee33359e818525549b5241adb6f5903a054bba (diff)
downloadtangerine-wallet-browser-d0d082d70c1e256aeb70f90fcdc864aeca00aed4.tar
tangerine-wallet-browser-d0d082d70c1e256aeb70f90fcdc864aeca00aed4.tar.gz
tangerine-wallet-browser-d0d082d70c1e256aeb70f90fcdc864aeca00aed4.tar.bz2
tangerine-wallet-browser-d0d082d70c1e256aeb70f90fcdc864aeca00aed4.tar.lz
tangerine-wallet-browser-d0d082d70c1e256aeb70f90fcdc864aeca00aed4.tar.xz
tangerine-wallet-browser-d0d082d70c1e256aeb70f90fcdc864aeca00aed4.tar.zst
tangerine-wallet-browser-d0d082d70c1e256aeb70f90fcdc864aeca00aed4.zip
Merge branch 'master' into i1340-SynchronousInjection
Diffstat (limited to 'app/scripts/lib/nonce-tracker.js')
-rw-r--r--app/scripts/lib/nonce-tracker.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/app/scripts/lib/nonce-tracker.js b/app/scripts/lib/nonce-tracker.js
index 0029ac953..2af40a27f 100644
--- a/app/scripts/lib/nonce-tracker.js
+++ b/app/scripts/lib/nonce-tracker.js
@@ -4,8 +4,9 @@ const Mutex = require('await-semaphore').Mutex
class NonceTracker {
- constructor ({ provider, getPendingTransactions, getConfirmedTransactions }) {
+ constructor ({ provider, blockTracker, getPendingTransactions, getConfirmedTransactions }) {
this.provider = provider
+ this.blockTracker = blockTracker
this.ethQuery = new EthQuery(provider)
this.getPendingTransactions = getPendingTransactions
this.getConfirmedTransactions = getConfirmedTransactions
@@ -53,7 +54,7 @@ class NonceTracker {
}
async _getCurrentBlock () {
- const blockTracker = this._getBlockTracker()
+ const blockTracker = this.blockTracker
const currentBlock = blockTracker.getCurrentBlock()
if (currentBlock) return currentBlock
return await Promise((reject, resolve) => {
@@ -139,11 +140,6 @@ 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