// Torrent sources in use keyed by the source string.
activeSources sync.Map
sourcesLogger log.Logger
-
+
smartBanCache smartBanCache
}
}
func (t *Torrent) close(wg *sync.WaitGroup) (err error) {
- t.closed.Set()
+ if !t.closed.Set() {
+ err = errors.New("already closed")
+ return
+ }
if t.storage != nil {
wg.Add(1)
go func() {