From: Matt Joiner Date: Wed, 11 Aug 2021 02:27:00 +0000 (+1000) Subject: Fix allocation of empty DhtNodes in TorrentSpec X-Git-Tag: v1.30.1~1 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=d03de7669b13b1dce17f28e91f0cce204b8987b8;p=btrtrc.git Fix allocation of empty DhtNodes in TorrentSpec https://github.com/anacrolix/torrent/pull/536#issuecomment-896392738 --- diff --git a/spec.go b/spec.go index e12bb0cb..6708db90 100644 --- a/spec.go +++ b/spec.go @@ -60,7 +60,7 @@ func TorrentSpecFromMetaInfoErr(mi *metainfo.MetaInfo) (*TorrentSpec, error) { DisplayName: info.Name, Webseeds: mi.UrlList, DhtNodes: func() (ret []string) { - ret = make([]string, len(mi.Nodes)) + ret = make([]string, 0, len(mi.Nodes)) for _, node := range mi.Nodes { ret = append(ret, string(node)) }