diff options
-rw-r--r-- | lib/torrent.js | 2 | ||||
-rw-r--r-- | test/blocklist-dht.js | 4 | ||||
-rw-r--r-- | test/blocklist-tracker.js | 4 | ||||
-rw-r--r-- | test/blocklist.js | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index 010f19f..6c65383 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -346,7 +346,7 @@ Torrent.prototype.addPeer = function (peer) { && self.client.blocked && self.client.blocked.contains(addrToIPPort(peer)[0])) { self.numBlockedPeers += 1 - self.emit('blocked-peer', peer) + self.emit('blockedPeer', peer) return false } else { self.emit('peer', peer) diff --git a/test/blocklist-dht.js b/test/blocklist-dht.js index 71dee81..9ddb316 100644 --- a/test/blocklist-dht.js +++ b/test/blocklist-dht.js @@ -49,7 +49,7 @@ test('blocklist blocks peers discovered via DHT', function (t) { t.fail('client1 should not find any peers') }) - torrent1.on('blocked-peer', function () { + torrent1.on('blockedPeer', function () { t.fail('client1 should not block any peers') }) }], @@ -64,7 +64,7 @@ test('blocklist blocks peers discovered via DHT', function (t) { var torrent2 = client2.add(leavesParsed) - torrent2.on('blocked-peer', function () { + torrent2.on('blockedPeer', function () { t.pass('client2 blocked connection to client1') }) diff --git a/test/blocklist-tracker.js b/test/blocklist-tracker.js index eefa338..e60d02d 100644 --- a/test/blocklist-tracker.js +++ b/test/blocklist-tracker.js @@ -42,7 +42,7 @@ test('blocklist blocks peers discovered via tracker', function (t) { cb(null, client1) }) - torrent1.on('blocked-peer', function () { + torrent1.on('blockedPeer', function () { t.fail('client1 should not block any peers') }) }], @@ -56,7 +56,7 @@ test('blocklist blocks peers discovered via tracker', function (t) { var torrent2 = client2.add(leavesParsed) - torrent2.on('blocked-peer', function () { + torrent2.on('blockedPeer', function () { t.pass('client2 blocked connection') // 2x, once for each client cb(null, client2) }) diff --git a/test/blocklist.js b/test/blocklist.js index 1d2fe68..b86f828 100644 --- a/test/blocklist.js +++ b/test/blocklist.js @@ -16,7 +16,7 @@ leavesParsed.announce = [] leavesParsed.announceList = [] function assertBlocked (t, torrent, addr) { - torrent.once('blocked-peer', function (_addr) { + torrent.once('blockedPeer', function (_addr) { t.equal(addr, _addr) }) t.notOk(torrent.addPeer(addr)) |