From e8a687d59eab7afeb41b42e0eda5039ace889f36 Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Tue, 26 Jul 2016 17:55:29 -0300 Subject: [PATCH] fetch address --- lib/storage.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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;