Checkpoint

This commit is contained in:
sairajzero 2023-01-28 02:05:53 +05:30
parent c757c2246b
commit 113a12aaf4

View File

@ -216,8 +216,6 @@ AddressService.prototype.getAddressHistory = function(addresses, options, stream
}, function(err) {
console.debug('getAddressHistory-END', err, results.totalCount, results.items.length);
if (err) {
return callback(err);
}
@ -318,7 +316,6 @@ AddressService.prototype.getAddressSummary = function(address, options, streamer
}, function(err) {
console.debug('getAddressSummary-END', err, result);
if (err) {
return callback(err);
}
@ -732,21 +729,18 @@ AddressService.prototype._streamAddressSummary = function(address, options, stre
});
}
console.debug("Q-PROCESS", id.txid);
self._transaction.getDetailedTransaction(id.txid, options, cb);
}, 4);
q.empty = () => console.debug("Q-EMPTY");
q.pause(); //pause and wait until queue is set
function process_chunk(err, tx){
console.debug("PROCESS_CHUNK:", q.length(), tx.txid());
streamer(err, tx);
if(err){
console.debug("PROCESS_CHUNK ERROR", err);
q.kill();
return callback();
@ -778,7 +772,6 @@ AddressService.prototype._streamAddressSummary = function(address, options, stre
},
// stream the rest of the confirmed txids out of the address index
function(next) {
console.debug("NEXT@781", next);
var txIdTransformStream = new Transform({ objectMode: true });
@ -793,7 +786,7 @@ AddressService.prototype._streamAddressSummary = function(address, options, stre
});
txIdTransformStream.on('end', function() {
console.debug("TRANSFORM-END");
q.drain = next;
q.resume();
});
@ -806,11 +799,6 @@ AddressService.prototype._streamAddressSummary = function(address, options, stre
var txidStream = self._getTxidStream(address, options);
txidStream.pipe(txIdTransformStream);
q.drain = function(){
console.debug("Q-DRAIN", next);
next();
};
}
], callback);