]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Fix https://github.com/anacrolix/torrent/issues/388
authorMatt Joiner <anacrolix@gmail.com>
Tue, 19 May 2020 05:00:08 +0000 (15:00 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Tue, 19 May 2020 05:00:08 +0000 (15:00 +1000)
torrent.go

index 927b25fdbdce28d07cc1ebab9992ed89c1393136..195027a3cca0f36a6b12eed3f162d1bc18281793 100644 (file)
@@ -377,6 +377,9 @@ func (t *Torrent) cacheLength() {
 }
 
 func (t *Torrent) setInfo(info *metainfo.Info) error {
+       if t.info != nil {
+               return errors.New("info already set")
+       }
        if err := validateInfo(info); err != nil {
                return fmt.Errorf("bad info: %s", err)
        }