return
}
-// Adds a torrent by InfoHash with a custom Storage implementation.
-// If the torrent already exists then this Storage is ignored and the
-// existing torrent returned with `new` set to `false`
+// Adds a torrent by InfoHash with a custom Storage implementation. If the torrent already exists
+// then this Storage is ignored and the existing torrent returned with `new` set to `false`.
func (cl *Client) AddTorrentOpt(opts AddTorrentOpts) (t *Torrent, new bool) {
infoHash := opts.InfoHash
cl.lock()
}
})
cl.torrents[infoHash] = t
+ t.setInfoBytesLocked(opts.InfoBytes)
cl.clearAcceptLimits()
t.updateWantPeersEvent()
// Tickle Client.waitAccept, new torrent may want conns.
InfoHash infohash.T
Storage storage.ClientImpl
ChunkSize pp.Integer
+ InfoBytes []byte
}
// Add or merge a torrent spec. Returns new if the torrent wasn't already in the client. See also