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