simplified should_announce_dht slightly

This commit is contained in:
Arvid Norberg 2009-07-18 16:50:56 +00:00
parent 3db42de4d9
commit e2b8434361
1 changed files with 2 additions and 1 deletions

View File

@ -283,13 +283,14 @@ namespace libtorrent
// don't announce private torrents
if (m_torrent_file->is_valid() && m_torrent_file->priv()) return false;
if (m_trackers.empty()) return true;
if (!m_settings.use_dht_as_fallback) return true;
int verified_trackers = 0;
for (std::vector<announce_entry>::const_iterator i = m_trackers.begin()
, end(m_trackers.end()); i != end; ++i)
if (i->verified) ++verified_trackers;
return verified_trackers == 0 || !m_settings.use_dht_as_fallback;
return verified_trackers == 0;
}
#endif