Skip to content

Commit 5020b53

Browse files
committed
fix: announces only have one info_hash
1 parent 36a4c22 commit 5020b53

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

server.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,9 @@ Server.prototype._onWebSocketRequest = function (socket, opts, params) {
350350
peers = response.peers
351351
delete response.peers
352352

353-
params.info_hash.forEach(function (info_hash) {
354-
if (socket.infoHashes.indexOf(info_hash) === -1) {
355-
socket.infoHashes.push(info_hash)
356-
}
357-
})
353+
if (socket.infoHashes.indexOf(params.info_hash) === -1) {
354+
socket.infoHashes.push(params.info_hash)
355+
}
358356

359357
response.info_hash = common.hexToBinary(params.info_hash)
360358

0 commit comments

Comments
 (0)