Exemple #1
0
		// this is true if we have all the pieces
		bool is_seed() const
		{
			return valid_metadata()
				&& (!m_picker
				|| m_state == torrent_status::seeding
				|| m_picker->num_have() == m_picker->num_pieces());
		}
Exemple #2
0
		// this is true if we have all the pieces that we want
		bool is_finished() const
		{
			if (is_seed()) return true;
			return valid_metadata() && m_torrent_file->num_pieces()
				- m_picker->num_have() - m_picker->num_filtered() == 0;
		}
Exemple #3
0
	bool torrent_handle::has_metadata() const
	{
		INVARIANT_CHECK;
		TORRENT_FORWARD_RETURN(valid_metadata(), false);
	}
Exemple #4
0
		// returns true if we have downloaded the given piece
		bool have_piece(int index) const
		{
			if (!valid_metadata()) return false;
			if (!has_picker()) return true;
			return m_picker->have_piece(index);
		}
Exemple #5
0
		bool is_seed() const
		{
			return valid_metadata()
				&& m_num_pieces == m_torrent_file.num_pieces();
		}