Skip to content

Commit f1cc540

Browse files
committed
Fix negative leecher count issue
Fixes webtorrent#65
1 parent 90c2a1a commit f1cc540

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/swarm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Swarm.prototype._onAnnounce_started = function (params, peer) {
4747
if (params.left === 0) this.complete += 1
4848
else this.incomplete += 1
4949
peer = this.peers[params.addr || params.peer_id] = {
50-
complete: false,
50+
complete: params.left === 0,
5151
ip: params.ip, // only http+udp
5252
peerId: params.peer_id, // as hex
5353
port: params.port, // only http+udp

0 commit comments

Comments
 (0)