From: Matt Joiner Date: Mon, 27 Jun 2016 05:46:27 +0000 (+1000) Subject: Throw away Torrent display name when info becomes available X-Git-Tag: v1.0.0~671 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=afc76861e06cefa9e0ee8a0058f4597aa5b5cbff;p=btrtrc.git Throw away Torrent display name when info becomes available --- diff --git a/torrent.go b/torrent.go index ac70a145..02350eed 100644 --- a/torrent.go +++ b/torrent.go @@ -96,6 +96,9 @@ type Torrent struct { } func (t *Torrent) setDisplayName(dn string) { + if t.haveInfo() { + return + } t.displayName = dn } @@ -223,6 +226,7 @@ func (t *Torrent) setInfoBytes(b []byte) error { } defer t.updateWantPeersEvent() t.info = ie + t.displayName = "" // Save a few bytes lol. t.cl.event.Broadcast() t.gotMetainfo.Set() t.storage, err = t.storageOpener.OpenTorrent(t.info)