Fix Purge reporting all peers as Seeders

PeerMaps now are constructed with a boolean value that tells the map
whether they are hosting seeders or leechers.
This commit is contained in:
Jimmy Zelinskie
2014-08-05 06:53:35 -04:00
parent 01fa778ce2
commit fc18028796
3 changed files with 17 additions and 8 deletions

View File

@@ -37,8 +37,8 @@ func (tkr *Tracker) HandleAnnounce(ann *models.Announce, w Writer) error {
if err == models.ErrTorrentDNE && !tkr.cfg.PrivateEnabled {
torrent = &models.Torrent{
Infohash: ann.Infohash,
Seeders: models.NewPeerMap(),
Leechers: models.NewPeerMap(),
Seeders: models.NewPeerMap(true),
Leechers: models.NewPeerMap(false),
}
err = conn.PutTorrent(torrent)