aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Miller <danjm.com@gmail.com>2018-09-11 23:21:49 +0800
committerDan Miller <danjm.com@gmail.com>2018-09-11 23:21:49 +0800
commiteb32ccb0c77c6e480c93f02c29faafec3cd93ec0 (patch)
treef7625117434d7a6b382da28a305b57c7d4d8fcc7
parent1552fe1c3eb8571036f8e32a3b2c5895849d19f1 (diff)
downloadtangerine-wallet-browser-eb32ccb0c77c6e480c93f02c29faafec3cd93ec0.tar
tangerine-wallet-browser-eb32ccb0c77c6e480c93f02c29faafec3cd93ec0.tar.gz
tangerine-wallet-browser-eb32ccb0c77c6e480c93f02c29faafec3cd93ec0.tar.bz2
tangerine-wallet-browser-eb32ccb0c77c6e480c93f02c29faafec3cd93ec0.tar.lz
tangerine-wallet-browser-eb32ccb0c77c6e480c93f02c29faafec3cd93ec0.tar.xz
tangerine-wallet-browser-eb32ccb0c77c6e480c93f02c29faafec3cd93ec0.tar.zst
tangerine-wallet-browser-eb32ccb0c77c6e480c93f02c29faafec3cd93ec0.zip
Ensure account-tracker currentBlockNumber is set on first block update.
-rw-r--r--app/scripts/lib/account-tracker.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/scripts/lib/account-tracker.js b/app/scripts/lib/account-tracker.js
index 3a52d5e8d..2e9340018 100644
--- a/app/scripts/lib/account-tracker.js
+++ b/app/scripts/lib/account-tracker.js
@@ -45,6 +45,9 @@ class AccountTracker {
this._blockTracker = opts.blockTracker
// blockTracker.currentBlock may be null
this._currentBlockNumber = this._blockTracker.getCurrentBlock()
+ this._blockTracker.once('latest', blockNumber => {
+ this._currentBlockNumber = blockNumber
+ })
// bind function for easier listener syntax
this._updateForBlock = this._updateForBlock.bind(this)
}