diff --git a/lib/services/address/index.js b/lib/services/address/index.js index a7e824dd..ee60cf82 100644 --- a/lib/services/address/index.js +++ b/lib/services/address/index.js @@ -876,7 +876,7 @@ AddressService.prototype._streamAddressSummary = function(address, options, stre //q.pause(); //pause and wait until queue is set 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) return; @@ -890,11 +890,12 @@ AddressService.prototype._streamAddressSummary = function(address, options, stre streamer(err, tx); - if((err || options.flag_stop) && !q.idle()){ + if((err || options.flag_stop) && !q.killed){ console.debug("KILL", options.flag_stop) q.kill(); + q.killed = true; return callback(); }