X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t.go;h=45856cc7acbeaa5988074f74435d078a49111a57;hb=HEAD;hp=765f3cf2a66ee6688b3895a6bd428c35e5bf9945;hpb=caa9400c52fe7a3ea43d8f70fd06a6730a618814;p=btrtrc.git diff --git a/t.go b/t.go index 765f3cf2..45856cc7 100644 --- 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 }