fix minor robustness issue in DHT bootstrap logic

This commit is contained in:
arvidn 2017-03-21 08:17:28 -04:00 committed by Arvid Norberg
parent f95f5b05c2
commit 4d397f5ebf
4 changed files with 1 additions and 14 deletions

View File

@ -1,3 +1,4 @@
* fix minor robustness issue in DHT bootstrap logic
* fix issue where torrent_status::num_seeds could be negative
* document deprecation of dynamic loading/unloading of torrents
* include user-agent in tracker announces in anonymous_mode for private torrents

View File

@ -55,8 +55,6 @@ public:
observer_ptr new_observer(void* ptr, udp::endpoint const& ep
, node_id const& id);
void trim_seed_nodes();
protected:
virtual bool invoke(observer_ptr o);

View File

@ -218,9 +218,6 @@ void node::bootstrap(std::vector<udp::endpoint> const& nodes
r->add_entry(node_id(0), *i, observer::flag_initial);
}
// make us start as far away from our node ID as possible
r->trim_seed_nodes();
#ifndef TORRENT_DISABLE_LOGGING
if (m_observer)
m_observer->log(dht_logger::node, "bootstrapping with %d nodes", count);

View File

@ -89,15 +89,6 @@ bootstrap::bootstrap(
char const* bootstrap::name() const { return "bootstrap"; }
void bootstrap::trim_seed_nodes()
{
// when we're bootstrapping, we want to start as far away from our ID as
// possible, to cover as much as possible of the ID space. So, remove all
// nodes except for the 32 that are farthest away from us
if (m_results.size() > 32)
m_results.erase(m_results.begin(), m_results.end() - 32);
}
void bootstrap::done()
{
#ifndef TORRENT_DISABLE_LOGGING