torrent/file.go | 4 ++++ diff --git a/torrent/file.go b/torrent/file.go index 87beef5b355da033ad9e61fefc65c4d1474d8017..13c73d17fc788de68df8a7bfd0e7519a67f4bc9c 100644 --- a/torrent/file.go +++ b/torrent/file.go @@ -160,6 +160,10 @@ this.Hash = h.Sum(this.Hash) return bencode.Unmarshal(data, &this.torrent_info) } +func (this *torrent_info_ex) MarshalBencode() ([]byte, error) { + return bencode.Marshal(&this.torrent_info) +} + type torrent_data struct { Info torrent_info_ex `bencode:"info"` Announce string `bencode:"announce"`