torrent.go | 3 +++ diff --git a/torrent.go b/torrent.go index 927b25fdbdce28d07cc1ebab9992ed89c1393136..195027a3cca0f36a6b12eed3f162d1bc18281793 100644 --- a/torrent.go +++ b/torrent.go @@ -377,6 +377,9 @@ t.length = &l } 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) }