From 5020b538cee4268c3da5e36e18db078a17b930ca Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Fri, 18 Mar 2016 15:57:18 -0700 Subject: [PATCH] fix: announces only have one info_hash --- server.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server.js b/server.js index ca7d366..301a092 100644 --- a/server.js +++ b/server.js @@ -350,11 +350,9 @@ Server.prototype._onWebSocketRequest = function (socket, opts, params) { peers = response.peers delete response.peers - params.info_hash.forEach(function (info_hash) { - if (socket.infoHashes.indexOf(info_hash) === -1) { - socket.infoHashes.push(info_hash) - } - }) + if (socket.infoHashes.indexOf(params.info_hash) === -1) { + socket.infoHashes.push(params.info_hash) + } response.info_hash = common.hexToBinary(params.info_hash)