void peer_lost(int index, peer_connection const* peer) { if (has_picker()) { m_picker->dec_refcount(index, peer); } #ifdef TORRENT_DEBUG else { TORRENT_ASSERT(is_seed()); } #endif }
void peer_has_all(peer_connection const* peer) { if (has_picker()) { m_picker->inc_refcount_all(peer); } #ifdef TORRENT_DEBUG else { TORRENT_ASSERT(is_seed()); } #endif }
void peer_has_all() { if (has_picker()) { m_picker->inc_refcount_all(); } #ifdef TORRENT_DEBUG else { TORRENT_ASSERT(is_seed()); } #endif }
void peer_lost(bitfield const& bits, peer_connection const* peer) { if (has_picker()) { if (bits.all_set() && bits.size() > 0) m_picker->dec_refcount_all(peer); else m_picker->dec_refcount(bits, peer); } #ifdef TORRENT_DEBUG else { TORRENT_ASSERT(is_seed()); } #endif }
void peer_lost(bitfield const& bits) { if (has_picker()) { if (bits.all_set()) m_picker->dec_refcount_all(); else m_picker->dec_refcount(bits); } #ifdef TORRENT_DEBUG else { TORRENT_ASSERT(is_seed()); } #endif }
int num_have() const { return has_picker() ? m_picker->num_have() : m_torrent_file->num_pieces(); }
// 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); }
// returns true if we have downloaded the given piece bool have_piece(int index) const { return has_picker()?m_picker->have_piece(index):true; }