From c41919807e495999f7ba493c933f573b9ffca30a Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 1 Dec 2014 23:33:38 -0600 Subject: [PATCH] Reuse the info bytes when marshalling torrent metainfo --- torrent.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/torrent.go b/torrent.go index 5d13d6a9..8e909a09 100644 --- a/torrent.go +++ b/torrent.go @@ -370,9 +370,13 @@ func (t *torrent) AnnounceList() (al [][]string) { } func (t *torrent) MetaInfo() *metainfo.MetaInfo { + if t.MetaData == nil { + panic("info bytes not set") + } return &metainfo.MetaInfo{ Info: metainfo.InfoEx{ - Info: *t.Info.Info, + Info: *t.Info.Info, + Bytes: t.MetaData, }, CreationDate: time.Now().Unix(), Comment: "dynamic metainfo from client", -- 2.48.1