Throw away Torrent display name when info becomes available

This commit is contained in:
Matt Joiner 2016-06-27 15:46:27 +10:00
parent 874bba43f8
commit afc76861e0
1 changed files with 4 additions and 0 deletions

View File

@ -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)