If peer is already complete, it should still be refreshed in the LRU cache

This commit is contained in:
Feross Aboukhadijeh 2017-02-02 17:25:46 -08:00
parent c2c8e36af7
commit ed3da2f39b

View File

@ -102,8 +102,8 @@ Swarm.prototype._onAnnounceUpdate = function (params, peer, id) {
this.complete += 1 this.complete += 1
this.incomplete -= 1 this.incomplete -= 1
peer.complete = true peer.complete = true
this.peers.set(id, peer)
} }
this.peers.set(id, peer)
} }
Swarm.prototype._getPeers = function (numwant, ownPeerId, isWebRTC) { Swarm.prototype._getPeers = function (numwant, ownPeerId, isWebRTC) {