client.go | 9 +++------ diff --git a/client.go b/client.go index 6201f3872ffce120e6ff06a711c8d5f41cc500b3..65259f493b95719b1c02850f31c626742c26ba45 100644 --- a/client.go +++ b/client.go @@ -1556,25 +1556,22 @@ // known, it will be set. The display name is replaced if the new spec // provides one. Returns new if the torrent wasn't already in the client. func (cl *Client) AddTorrentSpec(spec *TorrentSpec) (t *Torrent, new bool, err error) { t, new = cl.AddTorrentInfoHash(spec.InfoHash) - if spec.DisplayName != "" { t.SetDisplayName(spec.DisplayName) } - if spec.Info != nil { err = t.SetInfoBytes(spec.Info.Bytes) if err != nil { return } } - cl.mu.Lock() defer cl.mu.Unlock() - + if spec.ChunkSize != 0 { + t.chunkSize = pp.Integer(spec.ChunkSize) + } t.addTrackers(spec.Trackers) - t.maybeNewConns() - return }