Update index.js

This commit is contained in:
sairajzero 2023-02-05 16:23:34 +05:30
parent 76eb2debdd
commit 0b646fe453

View File

@ -876,7 +876,7 @@ AddressService.prototype._streamAddressSummary = function(address, options, stre
//q.pause(); //pause and wait until queue is set //q.pause(); //pause and wait until queue is set
function chunkCallback(err, tx){ function chunkCallback(err, tx){
console.debug("CHUNK", td_count, q.length(), q.idle()); console.debug("CHUNK", td_count, q.length(), q.killed);
if(!err && !tx) //no error or tx data (duplicate calls will have empty tx value) if(!err && !tx) //no error or tx data (duplicate calls will have empty tx value)
return; return;
@ -890,11 +890,12 @@ AddressService.prototype._streamAddressSummary = function(address, options, stre
streamer(err, tx); streamer(err, tx);
if((err || options.flag_stop) && !q.idle()){ if((err || options.flag_stop) && !q.killed){
console.debug("KILL", options.flag_stop) console.debug("KILL", options.flag_stop)
q.kill(); q.kill();
q.killed = true;
return callback(); return callback();
} }