From: Matt Joiner Date: Tue, 19 May 2020 05:00:08 +0000 (+1000) Subject: Fix https://github.com/anacrolix/torrent/issues/388 X-Git-Tag: v1.16.0~23 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=91afef873386483bc9ad5fe6d7eaf1b54b09a7f2;p=btrtrc.git Fix https://github.com/anacrolix/torrent/issues/388 --- diff --git a/torrent.go b/torrent.go index 927b25fd..195027a3 100644 --- a/torrent.go +++ b/torrent.go @@ -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) }