From a959bdd0f823e6d46df984ebc7b19f9c9d9523c7 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Wed, 15 Feb 2017 18:40:30 +1100 Subject: [PATCH] Revert "Quick fix for missing MetaInfo.Announce everywhere with trackers" This reverts commit b7a8d08bbf046d756e8d80744a188167e28a19de. --- metainfo/metainfo.go | 15 --------------- t.go | 4 ++-- torrent.go | 2 +- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/metainfo/metainfo.go b/metainfo/metainfo.go index 14ff8d04..decfc3a0 100644 --- a/metainfo/metainfo.go +++ b/metainfo/metainfo.go @@ -78,18 +78,3 @@ func (mi *MetaInfo) Magnet(displayName string, infoHash Hash) (m Magnet) { m.InfoHash = infoHash return } - -func (mi *MetaInfo) FlatTrackers() (ret []string) { - m := make(map[string]struct{}) - for _, t := range mi.AnnounceList { - for _, s := range t { - m[s] = struct{}{} - } - } - m[mi.Announce] = struct{}{} - ret = make([]string, 0, len(m)) - for s := range m { - ret = append(ret, s) - } - return -} diff --git a/t.go b/t.go index e6d231ca..ed810a5f 100644 --- a/t.go +++ b/t.go @@ -197,8 +197,8 @@ func (t *Torrent) String() string { return s } -func (t *Torrent) AddTrackers(urls []string) { +func (t *Torrent) AddTrackers(announceList [][]string) { t.cl.mu.Lock() defer t.cl.mu.Unlock() - t.addTrackers([][]string{urls}) + t.addTrackers(announceList) } diff --git a/torrent.go b/torrent.go index d515bc95..929e0bc6 100644 --- a/torrent.go +++ b/torrent.go @@ -1354,7 +1354,7 @@ func (t *Torrent) pieceHashed(piece int, correct bool) { if correct { pieceHashedCorrect.Add(1) } else { - log.Printf("%s: piece %d (%v) failed hash: %d connections contributed", t, piece, p.Hash, len(touchers)) + log.Printf("%s: piece %d (%x) failed hash: %d connections contributed", t, piece, p.Hash, len(touchers)) pieceHashedNotCorrect.Add(1) } }