Add TorrentStats.PiecesComplete

Fixes https://github.com/anacrolix/torrent/issues/352.
This commit is contained in:
Matt Joiner 2021-10-07 13:50:13 +11:00
parent 62c83a5b9c
commit 72a06d88fc
2 changed files with 2 additions and 0 deletions

View File

@ -1760,6 +1760,7 @@ func (t *Torrent) statsLocked() (ret TorrentStats) {
}
}
ret.ConnStats = t.stats.Copy()
ret.PiecesComplete = t.numPiecesCompleted()
return
}

View File

@ -13,4 +13,5 @@ type TorrentStats struct {
ActivePeers int
ConnectedSeeders int
HalfOpenPeers int
PiecesComplete int
}