Skip to content

Commit

Permalink
dev: bugfix completed download stat
Browse files Browse the repository at this point in the history
  • Loading branch information
da2ce7 committed Mar 19, 2024
1 parent 18b46df commit 439821c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/torrent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ impl Entry {
}
AnnounceEvent::Completed => {
let peer_old = self.peers.insert(peer.peer_id, *peer);
// Don't count if peer was not previously known
if peer_old.is_some() {
// Don't count if peer was not previously known and not already completed.
if peer_old.is_some_and(|p| p.event != AnnounceEvent::Completed) {
self.completed += 1;
did_torrent_stats_change = true;
}
Expand Down

0 comments on commit 439821c

Please sign in to comment.