diff --git a/lib/storage.js b/lib/storage.js index 7cf6a7f..b4c1960 100644 --- a/lib/storage.js +++ b/lib/storage.js @@ -609,6 +609,31 @@ Storage.prototype.storeActiveAddresses = function(walletId, addresses, cb) { }, cb); }; + +Storage.prototype.storeTxHistoryCache = function(walletId, firstPosition, items, cb) { + var self = this; + + self.db.collection(collections.CACHE).findOne({ + walletId: record.walletId, + type: 'historyCache' + }, function(err, result) { + if (err) return cb(err); + result = result || []; + + result + self.db.collection(collections.CACHE).update({ + walletId: record.walletId, + type: record.type, + key: record.key, + }, record, { + w: 1, + upsert: true, + }, next); + }, cb); +}; + + + Storage.prototype.fetchActiveAddresses = function(walletId, cb) { var self = this;