]> Sergey Matveev's repositories - btrtrc.git/blobdiff - t.go
Drop support for go 1.20
[btrtrc.git] / t.go
diff --git a/t.go b/t.go
index 765f3cf2a66ee6688b3895a6bd428c35e5bf9945..45856cc7acbeaa5988074f74435d078a49111a57 100644 (file)
--- a/t.go
+++ b/t.go
@@ -100,7 +100,10 @@ func (t *Torrent) Drop() {
        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
@@ -232,8 +235,8 @@ func (t *Torrent) Files() []*File {
 
 func (t *Torrent) AddPeers(pp []PeerInfo) (n int) {
        t.cl.lock()
+       defer t.cl.unlock()
        n = t.addPeers(pp)
-       t.cl.unlock()
        return
 }