Address Service: End stream without pausing first

There was an issue where streams would still be held open if "pause" was
called before "end", this would lead to http requests from the insight-api
not being returned with an error status as soon as possible but would
instead stay open.
This commit is contained in:
Braydon Fuller 2016-01-26 13:25:53 -05:00
parent a2acc0c80f
commit 3d7fb6f234
1 changed files with 0 additions and 4 deletions

View File

@ -854,7 +854,6 @@ AddressService.prototype.getInputs = function(addressStr, options, callback) {
if (inputs.length > self.maxInputsQueryLength) {
log.warn('Tried to query too many inputs (' + self.maxInputsQueryLength + ') for address '+ addressStr);
error = new Error('Maximum number of inputs (' + self.maxInputsQueryLength + ') per query reached');
stream.pause();
stream.end();
}
});
@ -1076,7 +1075,6 @@ AddressService.prototype.getOutputs = function(addressStr, options, callback) {
if (outputs.length > self.maxOutputsQueryLength) {
log.warn('Tried to query too many outputs (' + self.maxOutputsQueryLength + ') for address ' + addressStr);
error = new Error('Maximum number of outputs (' + self.maxOutputsQueryLength + ') per query reached');
stream.pause();
stream.end();
}
});
@ -1403,7 +1401,6 @@ AddressService.prototype._getAddressConfirmedInputsSummary = function(address, r
if (count > self.maxInputsQueryLength) {
log.warn('Tried to query too many inputs (' + self.maxInputsQueryLength + ') for summary of address ' + address.toString());
error = new Error('Maximum number of inputs (' + self.maxInputsQueryLength + ') per query reached');
inputsStream.pause();
inputsStream.end();
}
@ -1464,7 +1461,6 @@ AddressService.prototype._getAddressConfirmedOutputsSummary = function(address,
if (count > self.maxOutputsQueryLength) {
log.warn('Tried to query too many outputs (' + self.maxOutputsQueryLength + ') for summary of address ' + address.toString());
error = new Error('Maximum number of outputs (' + self.maxOutputsQueryLength + ') per query reached');
outputStream.pause();
outputStream.end();
}