Update index.js
This commit is contained in:
parent
5e6340be78
commit
ed79adb910
@ -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());
|
||||
console.debug("CHUNK", td_count, q.length(), q.idle());
|
||||
if(!err && !tx) //no error or tx data (duplicate calls will have empty tx value)
|
||||
return;
|
||||
|
||||
@ -944,11 +944,7 @@ AddressService.prototype._streamAddressSummary = function(address, options, stre
|
||||
});
|
||||
|
||||
txIdTransformStream.on('end', function() {
|
||||
q.drain = (e, d)=> {
|
||||
console.debug("END-DRAIN", e, d, d_count, td_count);
|
||||
next();
|
||||
};
|
||||
//q.resume();
|
||||
next();
|
||||
});
|
||||
|
||||
txIdTransformStream._transform = function(chunk, enc, cb) {
|
||||
@ -991,6 +987,15 @@ AddressService.prototype._streamAddressSummary = function(address, options, stre
|
||||
next();
|
||||
},
|
||||
|
||||
//wait for queue to complete
|
||||
function(next) {
|
||||
console.debug("WAITING FOR DRAIN")
|
||||
q.drain = ()=> {
|
||||
console.debug("END-DRAIN", d_count, td_count);
|
||||
next();
|
||||
};
|
||||
}
|
||||
|
||||
], callback);
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user