From 5843b7d2f64a865d93330eb96727fe9986e0f31a Mon Sep 17 00:00:00 2001 From: Yoann Ciabaud Date: Fri, 10 Jun 2016 00:29:56 +0200 Subject: [PATCH] Bugfix in manual peer eviction. --- lib/server/swarm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/server/swarm.js b/lib/server/swarm.js index 21940f8..4bb9820 100644 --- a/lib/server/swarm.js +++ b/lib/server/swarm.js @@ -119,7 +119,7 @@ Swarm.prototype._getPeers = function (numwant, ownPeerId, isWebRTC) { var peerId while ((peerId = ite()) && peers.length < numwant) { // Check manually if the peer is active - if (peers.maxAge && (Date.now() - peers.cache[peerId].modified) > peers.maxAge) { + if (this.peers.maxAge && (Date.now() - this.peers.cache[peerId].modified) > this.peers.maxAge) { peers.remove(peerId) continue }