From f1cc540e79feddd8c1be5b199d98b62845f70059 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 20 Apr 2015 20:02:05 -0700 Subject: [PATCH] Fix negative leecher count issue Fixes #65 --- lib/swarm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/swarm.js b/lib/swarm.js index 4029304..adf8406 100644 --- a/lib/swarm.js +++ b/lib/swarm.js @@ -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