Fix allocation of empty DhtNodes in TorrentSpec
https://github.com/anacrolix/torrent/pull/536#issuecomment-896392738
This commit is contained in:
parent
87294355fb
commit
d03de7669b
2
spec.go
2
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))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue