.. include:: header.rst

`home`__

__ reference.html

.. contents:: Table of contents
  :depth: 2
  :backlinks: none

.. raw:: html

	<a name="add_torrent_params"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+add_torrent_params&labels=documentation&body=Documentation+under+heading+%22class+add_torrent_params%22+could+be+improved">report issue</a>]</span>



add_torrent_params
------------------

Declared in "`libtorrent/add_torrent_params.hpp`__"


__ include/libtorrent/add_torrent_params.hpp

The `add_torrent_params`__ contains all the information in a .torrent file
along with all information necessary to add that torrent to a `session`__.
The key fields when adding a torrent are:

* ti - the immutable info-dict part of the torrent
* info_hash - when you don't have the metadata (.torrent file). This
  uniquely identifies the torrent and can validate the info-dict when
  received from the swarm.

In order to add a torrent to a `session`__, one of those fields must be set
in addition to ``save_path``. The `add_torrent_params`__ object can then be
passed into one of the ``session::add_torrent()`` overloads or
``session::async_add_torrent()``.

If you only specify the info-hash, the torrent file will be downloaded
from peers, which requires them to support the metadata extension. For
the metadata extension to work, libtorrent must be built with extensions
enabled (``TORRENT_DISABLE_EXTENSIONS`` must not be defined). It also
takes an optional ``name`` argument. This may be left empty in case no
name should be assigned to the torrent. In case it's not, the name is
used for the torrent as long as it doesn't have metadata. See
``torrent_handle::name``.

The ``add_torrent_params`` is also used when requesting resume data for a
torrent. It can be saved to and restored from a file and added back to a
new `session`__. For serialization and de-serialization of
``add_torrent_params`` objects, see `read_resume_data()`__ and
`write_resume_data()`__.

The ``add_torrent_params`` is also used to represent a parsed .torrent
file. It can be loaded via `load_torrent_file()`__, `load_torrent_buffer()`__ and
`load_torrent_parsed()`__. It can be saved via `write_torrent_file()`__.


__ reference-Add_Torrent.html#add_torrent_params
__ reference-Session.html#session
__ reference-Session.html#session
__ reference-Add_Torrent.html#add_torrent_params
__ reference-Session.html#session
__ reference-Resume_Data.html#read_resume_data()
__ reference-Resume_Data.html#write_resume_data()
__ reference-Core.html#load_torrent_file()
__ reference-Core.html#load_torrent_buffer()
__ reference-Core.html#load_torrent_parsed()
__ reference-Resume_Data.html#write_torrent_file()


.. parsed-literal::
	

	struct add_torrent_params
	{
	   int **version**  = LIBTORRENT_VERSION_NUM;
	   std::shared_ptr<torrent_info> ti;
	   aux::noexcept_movable<std::vector<std::string>> trackers;
	   aux::noexcept_movable<std::vector<int>> tracker_tiers;
	   aux::noexcept_movable<std::vector<std::pair<std::string, int>>> dht_nodes;
	   std::string name;
	   std::string save_path;
	   storage_mode_t **storage_mode**  = storage_mode_sparse;
	   client_data_t userdata;
	   aux::noexcept_movable<std::vector<download_priority_t>> file_priorities;
	   std::string trackerid;
	   torrent_flags_t **flags**  = torrent_flags::default_flags;
	   info_hash_t info_hashes;
	   int **max_uploads**  = -1;
	   int **max_connections**  = -1;
	   int **upload_limit**  = -1;
	   int **download_limit**  = -1;
	   std::int64_t **total_uploaded**  = 0;
	   std::int64_t **total_downloaded**  = 0;
	   int **active_time**  = 0;
	   int **finished_time**  = 0;
	   int **seeding_time**  = 0;
	   std::time_t **added_time**  = 0;
	   std::time_t **completed_time**  = 0;
	   std::time_t **last_seen_complete**  = 0;
	   int **num_complete**  = -1;
	   int **num_incomplete**  = -1;
	   int **num_downloaded**  = -1;
	   aux::noexcept_movable<std::vector<std::string>> http_seeds;
	   aux::noexcept_movable<std::vector<std::string>> url_seeds;
	   aux::noexcept_movable<std::vector<tcp::endpoint>> peers;
	   aux::noexcept_movable<std::vector<tcp::endpoint>> banned_peers;
	   aux::noexcept_movable<std::map<piece_index_t, bitfield>> unfinished_pieces;
	   typed_bitfield<piece_index_t> have_pieces;
	   typed_bitfield<piece_index_t> verified_pieces;
	   aux::noexcept_movable<std::vector<download_priority_t>> piece_priorities;
	   aux::vector<std::vector<sha256_hash>, file_index_t> merkle_trees;
	   aux::vector<std::vector<bool>, file_index_t> merkle_tree_mask;
	   aux::vector<std::vector<bool>, file_index_t> verified_leaf_hashes;
	   aux::noexcept_movable<std::map<file_index_t, std::string>> renamed_files;
	   std::time_t **last_download**  = 0;
	   std::time_t **last_upload**  = 0;
	};

.. raw:: html

	<a name="version"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bversion%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bversion%5D%22+could+be+improved">report issue</a>]</span>


version
	filled in by the constructor and should be left untouched. It is used
	for forward binary compatibility.
	


.. raw:: html

	<a name="ti"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bti%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bti%5D%22+could+be+improved">report issue</a>]</span>


ti
	`torrent_info`__ object with the torrent to add. Unless the
	info_hash is set, this is required to be initialized.
	

__ reference-Torrent_Info.html#torrent_info

.. raw:: html

	<a name="trackers"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Btrackers%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Btrackers%5D%22+could+be+improved">report issue</a>]</span>


trackers
	If the torrent doesn't have a tracker, but relies on the DHT to find
	peers, the ``trackers`` can specify tracker URLs for the torrent.
	


.. raw:: html

	<a name="tracker_tiers"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Btracker_tiers%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Btracker_tiers%5D%22+could+be+improved">report issue</a>]</span>


tracker_tiers
	the tiers the URLs in ``trackers`` belong to. Trackers belonging to
	different tiers may be treated differently, as defined by the multi
	tracker extension. This is optional, if not specified trackers are
	assumed to be part of tier 0, or whichever the last tier was as
	iterating over the trackers.
	


.. raw:: html

	<a name="dht_nodes"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bdht_nodes%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bdht_nodes%5D%22+could+be+improved">report issue</a>]</span>


dht_nodes
	a list of hostname and port pairs, representing DHT nodes to be added
	to the `session`__ (if DHT is enabled). The hostname may be an IP address.
	

__ reference-Session.html#session

.. raw:: html

	<a name="name"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bname%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bname%5D%22+could+be+improved">report issue</a>]</span>


name
	in case there's no other name in this torrent, this name will be used.
	The name out of the `torrent_info`__ object takes precedence if available.
	

__ reference-Torrent_Info.html#torrent_info

.. raw:: html

	<a name="save_path"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bsave_path%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bsave_path%5D%22+could+be+improved">report issue</a>]</span>


save_path
	the path where the torrent is or will be stored.
	
	.. note::
		On windows this path (and other paths) are interpreted as UNC
		paths. This means they must use backslashes as directory separators
		and may not contain the special directories "." or "..".
	
	Setting this to an absolute path performs slightly better than a
	relative path.
	


.. raw:: html

	<a name="storage_mode"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bstorage_mode%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bstorage_mode%5D%22+could+be+improved">report issue</a>]</span>


storage_mode
	One of the values from `storage_mode_t`__. For more information, see
	`storage allocation`__.
	

__ reference-Storage.html#storage_mode_t
__ manual-ref.html#storage-allocation

.. raw:: html

	<a name="userdata"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Buserdata%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Buserdata%5D%22+could+be+improved">report issue</a>]</span>


userdata
	The ``userdata`` parameter is optional and will be passed on to the
	extension constructor functions, if any
	(see `torrent_handle::add_extension()`__). It will also be stored in the
	torrent object and can be retrieved by calling `userdata()`__.
	

__ reference-Torrent_Handle.html#add_extension()
__ reference-Torrent_Handle.html#userdata()

.. raw:: html

	<a name="file_priorities"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bfile_priorities%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bfile_priorities%5D%22+could+be+improved">report issue</a>]</span>


file_priorities
	can be set to control the initial file priorities when adding a
	torrent. The semantics are the same as for
	``torrent_handle::prioritize_files()``. The file priorities specified
	in here take precedence over those specified in the resume data, if
	any.
	If this vector of file priorities is shorter than the number of files
	in the torrent, the remaining files (not covered by this) will still
	have the default download priority. This default can be changed by
	setting the default_dont_download torrent_flag.
	


.. raw:: html

	<a name="trackerid"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Btrackerid%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Btrackerid%5D%22+could+be+improved">report issue</a>]</span>


trackerid
	the default tracker id to be used when announcing to trackers. By
	default this is empty, and no tracker ID is used, since this is an
	optional argument. If a tracker returns a tracker ID, that ID is used
	instead of this.
	


.. raw:: html

	<a name="flags"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bflags%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bflags%5D%22+could+be+improved">report issue</a>]</span>


flags
	flags controlling aspects of this torrent and how it's added. See
	`torrent_flags_t`__ for details.
	
	.. note::
		The ``flags`` field is initialized with default flags by the
		constructor. In order to preserve default behavior when clearing or
		setting other flags, make sure to bitwise OR or in a flag or bitwise
		AND the inverse of a flag to clear it.
	

__ reference-Core.html#torrent_flags_t

.. raw:: html

	<a name="info_hashes"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Binfo_hashes%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Binfo_hashes%5D%22+could+be+improved">report issue</a>]</span>


info_hashes
	set this to the info hash of the torrent to add in case the info-hash
	is the only known property of the torrent. i.e. you don't have a
	.torrent file nor a magnet link.
	To add a magnet link, use `parse_magnet_uri()`__ to populate fields in the
	`add_torrent_params`__ object.
	

__ reference-Core.html#parse_magnet_uri()
__ reference-Add_Torrent.html#add_torrent_params

.. raw:: html

	<a name="max_uploads"></a>
	<a name="max_connections"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bmax_uploads+max_connections%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bmax_uploads+max_connections%5D%22+could+be+improved">report issue</a>]</span>


max_uploads max_connections
	``max_uploads``, ``max_connections``, ``upload_limit``,
	``download_limit`` correspond to the ``set_max_uploads()``,
	``set_max_connections()``, ``set_upload_limit()`` and
	``set_download_limit()`` functions on `torrent_handle`__. These values let
	you initialize these settings when the torrent is added, instead of
	calling these functions immediately following adding it.
	
	-1 means unlimited on these settings just like their counterpart
	functions on `torrent_handle`__
	
	For fine grained control over rate limits, including making them apply
	to local peers, see `peer classes`__.
	

__ reference-Torrent_Handle.html#torrent_handle
__ reference-Torrent_Handle.html#torrent_handle
__ manual-ref.html#peer-classes

.. raw:: html

	<a name="upload_limit"></a>
	<a name="download_limit"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bupload_limit+download_limit%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bupload_limit+download_limit%5D%22+could+be+improved">report issue</a>]</span>


upload_limit download_limit
	the upload and download rate limits for this torrent, specified in
	bytes per second. -1 means unlimited.
	


.. raw:: html

	<a name="total_uploaded"></a>
	<a name="total_downloaded"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Btotal_uploaded+total_downloaded%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Btotal_uploaded+total_downloaded%5D%22+could+be+improved">report issue</a>]</span>


total_uploaded total_downloaded
	the total number of bytes uploaded and downloaded by this torrent so
	far.
	


.. raw:: html

	<a name="active_time"></a>
	<a name="finished_time"></a>
	<a name="seeding_time"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bactive_time+finished_time+seeding_time%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bactive_time+finished_time+seeding_time%5D%22+could+be+improved">report issue</a>]</span>


active_time finished_time seeding_time
	the number of seconds this torrent has spent in started, finished and
	seeding state so far, respectively.
	


.. raw:: html

	<a name="added_time"></a>
	<a name="completed_time"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Badded_time+completed_time%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Badded_time+completed_time%5D%22+could+be+improved">report issue</a>]</span>


added_time completed_time
	if set to a non-zero value, this is the posix time of when this torrent
	was first added, including previous runs/sessions. If set to zero, the
	internal added_time will be set to the time of when `add_torrent()`__ is
	called.
	

__ reference-Session.html#add_torrent()

.. raw:: html

	<a name="last_seen_complete"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Blast_seen_complete%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Blast_seen_complete%5D%22+could+be+improved">report issue</a>]</span>


last_seen_complete
	if set to non-zero, initializes the time (expressed in posix time) when
	we last saw a seed or peers that together formed a complete copy of the
	torrent. If left set to zero, the internal counterpart to this field
	will be updated when we see a seed or a distributed copies >= 1.0.
	


.. raw:: html

	<a name="num_complete"></a>
	<a name="num_incomplete"></a>
	<a name="num_downloaded"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bnum_complete+num_incomplete+num_downloaded%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bnum_complete+num_incomplete+num_downloaded%5D%22+could+be+improved">report issue</a>]</span>


num_complete num_incomplete num_downloaded
	these field can be used to initialize the torrent's cached scrape data.
	The scrape data is high level metadata about the current state of the
	swarm, as returned by the tracker (either when announcing to it or by
	sending a specific scrape request). ``num_complete`` is the number of
	peers in the swarm that are seeds, or have every piece in the torrent.
	``num_incomplete`` is the number of peers in the swarm that do not have
	every piece. ``num_downloaded`` is the number of times the torrent has
	been downloaded (not initiated, but the number of times a download has
	completed).
	
	Leaving any of these values set to -1 indicates we don't know, or we
	have not received any scrape data.
	


.. raw:: html

	<a name="http_seeds"></a>
	<a name="url_seeds"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bhttp_seeds+url_seeds%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bhttp_seeds+url_seeds%5D%22+could+be+improved">report issue</a>]</span>


http_seeds url_seeds
	URLs can be added to these two lists to specify additional web
	seeds to be used by the torrent. If the ``flag_override_web_seeds``
	is set, these will be the _only_ ones to be used. i.e. any web seeds
	found in the .torrent file will be overridden.
	
	http_seeds expects URLs to web servers implementing the original HTTP
	seed specification `BEP 17`_.
	
	url_seeds expects URLs to regular web servers, aka "get right" style,
	specified in `BEP 19`_.
	


.. raw:: html

	<a name="peers"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bpeers%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bpeers%5D%22+could+be+improved">report issue</a>]</span>


peers
	peers to add to the torrent, to be tried to be connected to as
	bittorrent peers.
	


.. raw:: html

	<a name="banned_peers"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bbanned_peers%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bbanned_peers%5D%22+could+be+improved">report issue</a>]</span>


banned_peers
	peers banned from this torrent. The will not be connected to
	


.. raw:: html

	<a name="unfinished_pieces"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bunfinished_pieces%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bunfinished_pieces%5D%22+could+be+improved">report issue</a>]</span>


unfinished_pieces
	this is a map of partially downloaded piece. The key is the piece index
	and the value is a `bitfield`__ where each bit represents a 16 kiB block.
	A set bit means we have that block.
	

__ reference-Utility.html#bitfield

.. raw:: html

	<a name="have_pieces"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bhave_pieces%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bhave_pieces%5D%22+could+be+improved">report issue</a>]</span>


have_pieces
	this is a `bitfield`__ indicating which pieces we already have of this
	torrent.
	

__ reference-Utility.html#bitfield

.. raw:: html

	<a name="verified_pieces"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bverified_pieces%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bverified_pieces%5D%22+could+be+improved">report issue</a>]</span>


verified_pieces
	when in seed_mode, pieces with a set bit in this `bitfield`__ have been
	verified to be valid. Other pieces will be verified the first time a
	peer requests it.
	

__ reference-Utility.html#bitfield

.. raw:: html

	<a name="piece_priorities"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bpiece_priorities%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bpiece_priorities%5D%22+could+be+improved">report issue</a>]</span>


piece_priorities
	this sets the priorities for each individual piece in the torrent. Each
	element in the vector represent the piece with the same index. If you
	set both file- and piece priorities, file priorities will take
	precedence.
	


.. raw:: html

	<a name="merkle_trees"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bmerkle_trees%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bmerkle_trees%5D%22+could+be+improved">report issue</a>]</span>


merkle_trees
	v2 hashes, if known
	


.. raw:: html

	<a name="merkle_tree_mask"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bmerkle_tree_mask%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bmerkle_tree_mask%5D%22+could+be+improved">report issue</a>]</span>


merkle_tree_mask
	if set, indicates which hashes are included in the corresponding
	vector of ``merkle_trees``. These bitmasks always cover the full
	tree, a cleared bit means the hash is all zeros (i.e. not set) and
	set bit means the next hash in the corresponding vector in
	``merkle_trees`` is the hash for that node. This is an optimization
	to avoid storing a lot of zeros.
	


.. raw:: html

	<a name="verified_leaf_hashes"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Bverified_leaf_hashes%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Bverified_leaf_hashes%5D%22+could+be+improved">report issue</a>]</span>


verified_leaf_hashes
	bit-fields indicating which v2 leaf hashes have been verified
	against the root hash. If this vector is empty and merkle_trees is
	non-empty it implies that all hashes in merkle_trees are verified.
	


.. raw:: html

	<a name="renamed_files"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Brenamed_files%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Brenamed_files%5D%22+could+be+improved">report issue</a>]</span>


renamed_files
	this is a map of file indices in the torrent and new filenames to be
	applied before the torrent is added.
	


.. raw:: html

	<a name="last_download"></a>
	<a name="last_upload"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:add_torrent_params%3A%3A%5Blast_download+last_upload%5D&labels=documentation&body=Documentation+under+heading+%22add_torrent_params%3A%3A%5Blast_download+last_upload%5D%22+could+be+improved">report issue</a>]</span>


last_download last_upload
	the posix time of the last time payload was received or sent for this
	torrent, respectively.
	


.. raw:: html

	<a name="client_data_t"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:class+client_data_t&labels=documentation&body=Documentation+under+heading+%22class+client_data_t%22+could+be+improved">report issue</a>]</span>



client_data_t
-------------

Declared in "`libtorrent/client_data.hpp`__"


__ include/libtorrent/client_data.hpp

A thin wrapper around a void pointer used as "user data". i.e. an opaque
cookie passed in to libtorrent and returned on demand. It adds type-safety by
requiring the same type be requested out of it as was assigned to it.




.. parsed-literal::
	

	struct client_data_t
	{
	   **client_data_t** () = default;
	   explicit **client_data_t** (T\* v);
	   client_data_t& **operator=** (T\* v);
	   T\* **get** () const;
	   explicit operator **T** () const;
	   client_data_t& **operator=** (void const\*) = delete;
	   client_data_t& **operator=** (void\*) = delete;
	   operator **void*** () const = delete;
	   operator void **const*** () const = delete;
	
	   template <typename T, typename **U**  = typename std::enable_if<std::is_pointer<T>::value>::type>
	};

.. raw:: html

	<a name="client_data_t()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:client_data_t%3A%3A%5Bclient_data_t%28%29%5D&labels=documentation&body=Documentation+under+heading+%22client_data_t%3A%3A%5Bclient_data_t%28%29%5D%22+could+be+improved">report issue</a>]</span>



client_data_t()
...............

.. parsed-literal::
	
	**client_data_t** () = default;
	

construct a nullptr client data



.. raw:: html

	<a name="const*()"></a>
	<a name="operator=()"></a>
	<a name="void*()"></a>

.. raw:: html

	<span class="report-issue">[<a href="http://github.com/arvidn/libtorrent/issues/new?title=docs:client_data_t%3A%3A%5Bconst%2A%28%29+operator%3D%28%29+void%2A%28%29%5D&labels=documentation&body=Documentation+under+heading+%22client_data_t%3A%3A%5Bconst%2A%28%29+operator%3D%28%29+void%2A%28%29%5D%22+could+be+improved">report issue</a>]</span>



const*() operator=() void*()
............................

.. parsed-literal::
	
	client_data_t& **operator=** (void const\*) = delete;
	client_data_t& **operator=** (void\*) = delete;
	operator **void*** () const = delete;
	operator void **const*** () const = delete;
	

we don't allow type-unsafe operations





.. _`BEP 3`: https://www.bittorrent.org/beps/bep_0003.html
.. _`BEP 17`: https://www.bittorrent.org/beps/bep_0017.html
.. _extensions: manual-ref.html#extensions
.. _`BEP 52`: https://www.bittorrent.org/beps/bep_0052.html
.. _`BEP 19`: https://www.bittorrent.org/beps/bep_0019.html
.. _`BEP 38`: https://www.bittorrent.org/beps/bep_0038.html
.. _`rate based choking`: manual-ref.html#rate-based-choking
.. _`BEP 42`: https://www.bittorrent.org/beps/bep_0042.html
