diff --git a/lib/http/client.js b/lib/http/client.js index c06fbd03..b8d3e12b 100644 --- a/lib/http/client.js +++ b/lib/http/client.js @@ -134,7 +134,7 @@ HTTPClient.prototype._close = function close(callback) { if (!this.socket) return utils.nextTick(callback); - this.socket.destroy(); + this.socket.disconnect(); this.socket = null; utils.nextTick(callback); diff --git a/test/http-test.js b/test/http-test.js index c3904a6f..eac59cf7 100644 --- a/test/http-test.js +++ b/test/http-test.js @@ -183,6 +183,7 @@ describe('HTTP', function() { it('should cleanup', function(cb) { constants.tx.COINBASE_MATURITY = 100; + wallet.close(); node.close(cb); }); });