diff --git a/t.go b/t.go index ba73d51851..d080072ac6 100644 --- a/t.go +++ b/t.go @@ -266,6 +266,12 @@ func (t *Torrent) AddTrackers(announceList [][]string) { t.addTrackers(announceList) } +func (t *Torrent) ClearTrackers() { + t.cl.lock() + defer t.cl.unlock() + t.clearTrackers() +} + func (t *Torrent) Piece(i pieceIndex) *Piece { return t.piece(i) } diff --git a/torrent.go b/torrent.go index dfb980baef..9326e338da 100644 --- a/torrent.go +++ b/torrent.go @@ -1708,6 +1708,10 @@ func (t *Torrent) addTrackers(announceList [][]string) { t.updateWantPeersEvent() } +func (t *Torrent) clearTrackers() { + clear(t.metainfo.AnnounceList) +} + // Don't call this before the info is available. func (t *Torrent) bytesCompleted() int64 { if !t.haveInfo() { diff --git a/webseed/client.go b/webseed/client.go index 5e3c28b885..7740fb8ed9 100644 --- a/webseed/client.go +++ b/webseed/client.go @@ -188,4 +188,4 @@ func readRequestPartResponses(ctx context.Context, parts []requestPart) (_ []byt } } return buf.Bytes(), err -} \ No newline at end of file +}