diff --git a/ChangeLog b/ChangeLog index 14499ed79..f87feb3e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/include/libtorrent/kademlia/refresh.hpp b/include/libtorrent/kademlia/refresh.hpp index e0d9a46e2..e6b58bdac 100644 --- a/include/libtorrent/kademlia/refresh.hpp +++ b/include/libtorrent/kademlia/refresh.hpp @@ -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); diff --git a/src/kademlia/node.cpp b/src/kademlia/node.cpp index a268efd94..059d7490b 100644 --- a/src/kademlia/node.cpp +++ b/src/kademlia/node.cpp @@ -218,9 +218,6 @@ void node::bootstrap(std::vector 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); diff --git a/src/kademlia/refresh.cpp b/src/kademlia/refresh.cpp index e6aa5c70f..a41648551 100644 --- a/src/kademlia/refresh.cpp +++ b/src/kademlia/refresh.cpp @@ -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