use info hash from params instead of passing it separately

This commit is contained in:
Steven Siloti 2017-12-13 16:01:08 -08:00 committed by Arvid Norberg
parent 7b06a5ee6e
commit 9e0a3aead1
3 changed files with 5 additions and 7 deletions

View File

@ -330,8 +330,7 @@ namespace libtorrent {
public: public:
torrent(aux::session_interface& ses, int block_size torrent(aux::session_interface& ses, int block_size
, bool session_paused, add_torrent_params const& p , bool session_paused, add_torrent_params const& p);
, sha1_hash const& info_hash);
~torrent() override; ~torrent() override;
// This may be called from multiple threads // This may be called from multiple threads

View File

@ -4954,7 +4954,7 @@ namespace {
torrent_ptr = std::make_shared<torrent>(*this torrent_ptr = std::make_shared<torrent>(*this
, 16 * 1024, m_paused , 16 * 1024, m_paused
, params, params.info_hash); , params);
torrent_ptr->set_queue_position(m_download_queue.end_index()); torrent_ptr->set_queue_position(m_download_queue.end_index());
return std::make_pair(torrent_ptr, true); return std::make_pair(torrent_ptr, true);

View File

@ -163,8 +163,7 @@ namespace libtorrent {
aux::session_interface& ses aux::session_interface& ses
, int const block_size , int const block_size
, bool const session_paused , bool const session_paused
, add_torrent_params const& p , add_torrent_params const& p)
, sha1_hash const& info_hash)
: torrent_hot_members(ses, p, block_size, session_paused) : torrent_hot_members(ses, p, block_size, session_paused)
, m_tracker_timer(ses.get_io_service()) , m_tracker_timer(ses.get_io_service())
, m_inactivity_timer(ses.get_io_service()) , m_inactivity_timer(ses.get_io_service())
@ -179,7 +178,7 @@ namespace libtorrent {
, m_storage_constructor(p.storage) , m_storage_constructor(p.storage)
, m_added_time(p.added_time ? p.added_time : std::time(nullptr)) , m_added_time(p.added_time ? p.added_time : std::time(nullptr))
, m_completed_time(p.completed_time) , m_completed_time(p.completed_time)
, m_info_hash(info_hash) , m_info_hash(p.info_hash)
, m_error_file(torrent_status::error_file_none) , m_error_file(torrent_status::error_file_none)
, m_sequence_number(-1) , m_sequence_number(-1)
, m_announce_to_trackers(!(p.flags & torrent_flags::paused)) , m_announce_to_trackers(!(p.flags & torrent_flags::paused))
@ -244,7 +243,7 @@ namespace libtorrent {
} }
if (!m_torrent_file) if (!m_torrent_file)
m_torrent_file = (p.ti ? p.ti : std::make_shared<torrent_info>(info_hash)); m_torrent_file = (p.ti ? p.ti : std::make_shared<torrent_info>(m_info_hash));
// --- WEB SEEDS --- // --- WEB SEEDS ---