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
|
//q.pause(); //pause and wait until queue is set
|
||||||
|
|
||||||
function chunkCallback(err, tx){
|
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)
|
if(!err && !tx) //no error or tx data (duplicate calls will have empty tx value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -944,11 +944,7 @@ AddressService.prototype._streamAddressSummary = function(address, options, stre
|
|||||||
});
|
});
|
||||||
|
|
||||||
txIdTransformStream.on('end', function() {
|
txIdTransformStream.on('end', function() {
|
||||||
q.drain = (e, d)=> {
|
next();
|
||||||
console.debug("END-DRAIN", e, d, d_count, td_count);
|
|
||||||
next();
|
|
||||||
};
|
|
||||||
//q.resume();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
txIdTransformStream._transform = function(chunk, enc, cb) {
|
txIdTransformStream._transform = function(chunk, enc, cb) {
|
||||||
@ -991,6 +987,15 @@ AddressService.prototype._streamAddressSummary = function(address, options, stre
|
|||||||
next();
|
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);
|
], callback);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user