From df8de6f608efaffcb84e20c7ef249bc9ebe7cdef Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 29 Mar 2015 20:40:21 +1300 Subject: [PATCH] client/websocket: warning on invalid info_hash --- lib/websocket-tracker.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/websocket-tracker.js b/lib/websocket-tracker.js index d64f7f2..07d2b3e 100644 --- a/lib/websocket-tracker.js +++ b/lib/websocket-tracker.js @@ -86,7 +86,9 @@ WebSocketTracker.prototype._onSocketMessage = function (data) { return self.client.emit('warning', new Error('Invalid tracker response')) } - if (data.info_hash !== self.client._infoHash.toString('binary')) return + if (data.info_hash !== self.client._infoHash.toString('binary')) { + return self.client.emit('warning', new Error('Invalid tracker response')) + } debug('received %s from %s', JSON.stringify(data), self._announceUrl)