fix: announces only have one info_hash

This commit is contained in:
Feross Aboukhadijeh 2016-03-18 15:57:18 -07:00
parent 36a4c2208a
commit 5020b538ce

View File

@ -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)