diff --git a/lib/services/address/index.js b/lib/services/address/index.js index a580d4f5..fde98884 100644 --- a/lib/services/address/index.js +++ b/lib/services/address/index.js @@ -76,8 +76,20 @@ AddressService.prototype.getAddressHistory = function(addresses, options, callba return callback(err); } - options.txIdList = lodash.uniqWith(options.txIdList, lodash.isEqual); - options.txIdList = lodash.orderBy(options.txIdList, ['height'], ['desc']); + var unique = {}; + var list = []; + + for (let i = 0; i < options.txIdList.length; i++) { + unique[options.txIdList[i].txid + options.txIdList[i].height] = options.txIdList[i]; + } + + for (var prop in unique) { + list.push(unique[prop]); + } + + options.txIdList = list.sort(function(a, b) { + return b.height - a.height; + }); self._getAddressTxHistory(options, function(err, txList) { diff --git a/lib/services/db/index.js b/lib/services/db/index.js index 854085ff..ecda6d08 100644 --- a/lib/services/db/index.js +++ b/lib/services/db/index.js @@ -82,7 +82,6 @@ DB.prototype.start = function(callback) { keyEncoding: 'binary', valueEncoding: 'binary', writeBufferSize: 8 * 1024 * 1024, - maxOpenFiles: 3000, cacheSize: 1024 * 1024 * 1024 // 1 GB of memory for cache. }); diff --git a/lib/services/mempool/index.js b/lib/services/mempool/index.js index 077ef6a6..150e12ca 100644 --- a/lib/services/mempool/index.js +++ b/lib/services/mempool/index.js @@ -210,7 +210,6 @@ MempoolService.prototype._getAddressOperations = function(tx, reverse) { }; MempoolService.prototype._onTransaction = function(tx) { - var self = this; var ops = [{ type: 'put',