Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2014-12-31 11:50:01 +0300
committerFeross Aboukhadijeh <feross@feross.org>2014-12-31 12:08:01 +0300
commite3404f7a75283d9a76fbf80558a7aec292aea53c (patch)
tree278886f18b1d5a8d046e208ca13962d352517f26 /lib/torrent.js
parent889e04156709321ff694679b7ea064f18bbb08e3 (diff)
test that blocklist blocks connections to peers
Diffstat (limited to 'lib/torrent.js')
-rw-r--r--lib/torrent.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index e6bd82e..9f6edde 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -331,8 +331,9 @@ Torrent.prototype.addPeer = function (peer) {
var self = this
// TODO: extract IP address from peer object and check blocklist
- if (typeof peer === 'string' &&
- self.client.blocked && self.client.blocked.contains(addrToIPPort(peer)[0])) {
+ if (typeof peer === 'string'
+ && self.client.blocked
+ && self.client.blocked.contains(addrToIPPort(peer)[0])) {
self.numBlockedPeers += 1
self.emit('blocked-peer', peer)
} else {