Merge pull request #552 from isocolsky/fix/history-cache
Fix cache reset
This commit is contained in:
commit
da63dbdbc8
|
@ -2448,7 +2448,7 @@ WalletService.prototype._normalizeTxHistory = function(txs) {
|
|||
});
|
||||
};
|
||||
|
||||
WalletService._cachedBlockheight;
|
||||
WalletService._cachedBlockheight = {};
|
||||
WalletService._clearBlockchainHeightCache = function() {
|
||||
WalletService._cachedBlockheight.current = null;
|
||||
};
|
||||
|
@ -2457,7 +2457,6 @@ WalletService.prototype._getBlockchainHeight = function(network, cb) {
|
|||
var self = this;
|
||||
|
||||
var now = Date.now();
|
||||
if (!WalletService._cachedBlockheight) WalletService._cachedBlockheight = {};
|
||||
var cache = WalletService._cachedBlockheight;
|
||||
|
||||
function fetchFromBlockchain(cb) {
|
||||
|
|
|
@ -5930,7 +5930,7 @@ describe('Wallet service', function() {
|
|||
it('should get real # of confirmations based on current block height', function(done) {
|
||||
var _confirmations = Defaults.CONFIRMATIONS_TO_START_CACHING;
|
||||
Defaults.CONFIRMATIONS_TO_START_CACHING = 6;
|
||||
WalletService._cachedBlockheight = null;
|
||||
WalletService._cachedBlockheight = {};
|
||||
|
||||
var h = helpers.historyCacheTest(20);
|
||||
_.each(h, function(x, i) {
|
||||
|
@ -5989,7 +5989,7 @@ describe('Wallet service', function() {
|
|||
it('should get cached # of confirmations if current height unknown', function(done) {
|
||||
var _confirmations = Defaults.CONFIRMATIONS_TO_START_CACHING;
|
||||
Defaults.CONFIRMATIONS_TO_START_CACHING = 6;
|
||||
WalletService._cachedBlockheight = null;
|
||||
WalletService._cachedBlockheight = {};
|
||||
|
||||
var h = helpers.historyCacheTest(20);
|
||||
helpers.stubHistory(h);
|
||||
|
|
Loading…
Reference in New Issue