This commit is contained in:
sairajzero 2023-01-28 20:05:57 +05:30
parent 40b42019ab
commit 88c276ad49

View File

@ -208,7 +208,7 @@ AddressService.prototype.getAddressHistory = function(addresses, options, stream
return log.error(err);
if(!options.txNotNeeded && results.items.length < MAX_TX_QUERY_LIMIT)
if(!results.items.some(x => x.txid === tx.txid)) //push only if tx not already in array
if(!results.items.some(x => x.txid() === tx.txid())) //push only if tx not already in array
results.items.push(tx);
streamer(null, tx);
@ -223,6 +223,7 @@ AddressService.prototype.getAddressHistory = function(addresses, options, stream
//sort items in desc block-height, then asc txid (if same height)
results.items.sort((a, b) => b.__height - a.__height || a.txid().localeCompare(b.txid()));
console.debug("ITEMS:", results.items)
//TODO: sorting of tx list (results.items)
callback(null, results);
@ -825,9 +826,8 @@ AddressService.prototype._streamAddressSummary = function(address, options, stre
q.pause(); //pause and wait until queue is set
function process_chunk(err, tx, ...args){
function process_chunk(err, tx){
console.debug("PROCESS_CHUNK", args)
streamer(err, tx);
if(err){