defer wg.Wait()
t.cl.lock()
defer t.cl.unlock()
- t.cl.dropTorrent(t.infoHash, &wg)
+ err := t.cl.dropTorrent(t.infoHash, &wg)
+ if err != nil {
+ panic(err)
+ }
}
// Number of bytes of the entire torrent we have completed. This is the sum of
func (t *Torrent) AddPeers(pp []PeerInfo) (n int) {
t.cl.lock()
+ defer t.cl.unlock()
n = t.addPeers(pp)
- t.cl.unlock()
return
}