return t.seeding()
}
-// Clobbers the torrent display name. The display name is used as the torrent
-// name if the metainfo is not available.
+// Clobbers the torrent display name if metainfo is unavailable.
+// The display name is used as the torrent name while the metainfo is unavailable.
func (t *Torrent) SetDisplayName(dn string) {
t.nameMu.Lock()
- defer t.nameMu.Unlock()
- if t.haveInfo() {
- return
+ if !t.haveInfo() {
+ t.displayName = dn
}
- t.displayName = dn
+ t.nameMu.Unlock()
}
// The current working name for the torrent. Either the name in the info dict,