From 91afef873386483bc9ad5fe6d7eaf1b54b09a7f2 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Tue, 19 May 2020 15:00:08 +1000 Subject: [PATCH] Fix https://github.com/anacrolix/torrent/issues/388 --- torrent.go | 3 +++ 1 file changed, 3 insertions(+) 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) } -- 2.48.1