// 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()); }
// 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; }
bool torrent_handle::has_metadata() const { INVARIANT_CHECK; TORRENT_FORWARD_RETURN(valid_metadata(), false); }
// 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); }
bool is_seed() const { return valid_metadata() && m_num_pieces == m_torrent_file.num_pieces(); }