Bugfix in manual peer eviction.

This commit is contained in:
Yoann Ciabaud 2016-06-10 00:29:56 +02:00
parent 7f98203d5e
commit 5843b7d2f6

View File

@ -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
}