This commit is contained in:
sairajzero 2023-01-28 15:38:24 +05:30
parent 2870fe8aa3
commit aa5d986217

View File

@ -180,7 +180,7 @@ AddressService.prototype.getAddressHistory = function(addresses, options, stream
options.from = options.from || 0; options.from = options.from || 0;
options.to = options.to || 0xffffffff; options.to = options.to || 0xffffffff;
if(!callback){ //if only 3 args, then streamer is callback if(typeof callback !== 'function'){ //if only 3 args, then streamer is callback
callback = streamer; callback = streamer;
streamer = () => null; //NULL fn streamer = () => null; //NULL fn
} }
@ -285,7 +285,7 @@ AddressService.prototype.getAddressSummary = function(address, options, streamer
options.queryMempool = true; options.queryMempool = true;
} }
if(!callback){ //if only 3 args, then streamer is callback if(typeof callback !== 'function'){ //if only 3 args, then streamer is callback
callback = streamer; callback = streamer;
streamer = () => null; //NULL fn streamer = () => null; //NULL fn
} }
@ -786,15 +786,14 @@ AddressService.prototype._streamAddressSummary = function(address, options, stre
}); });
txIdTransformStream.on('end', function() { txIdTransformStream.on('end', function() {
q.drain = (e, d) => { q.drain = next;
console.debug("Q-DRAIN", e, d) console.debug(q.drain);
next();
};
q.resume(); q.resume();
}); });
txIdTransformStream._transform = function(chunk, enc, cb) { txIdTransformStream._transform = function(chunk, enc, cb) {
var txInfo = self._encoding.decodeAddressIndexKey(chunk); var txInfo = self._encoding.decodeAddressIndexKey(chunk);
self._db.get(chunk, (err, data) => console.debug(data)); //test-check
q.push({ txid: txInfo.txid, height: txInfo.height }, process_chunk); q.push({ txid: txInfo.txid, height: txInfo.height }, process_chunk);
cb(); cb();