From 3d7fb6f234e0d02a2ad6942abc56eb9fad62c3ae Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Tue, 26 Jan 2016 13:25:53 -0500 Subject: [PATCH] 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. --- lib/services/address/index.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/services/address/index.js b/lib/services/address/index.js index 17199b25..61eed5ef 100644 --- a/lib/services/address/index.js +++ b/lib/services/address/index.js @@ -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(); }