Fix negative leecher count issue

Fixes #65
This commit is contained in:
Feross Aboukhadijeh 2015-04-20 20:02:05 -07:00
parent 90c2a1a6e1
commit f1cc540e79

View File

@ -47,7 +47,7 @@ Swarm.prototype._onAnnounce_started = function (params, peer) {
if (params.left === 0) this.complete += 1
else this.incomplete += 1
peer = this.peers[params.addr || params.peer_id] = {
complete: false,
complete: params.left === 0,
ip: params.ip, // only http+udp
peerId: params.peer_id, // as hex
port: params.port, // only http+udp