the dht node will now add nodes who sends announce_peer with correct write token. Fixed bug in session where nodes from a .torrent were added to the node even though if it wasn't running.
This commit is contained in:
parent
2daaa9f8d2
commit
4f2d147e07
|
@ -431,6 +431,11 @@ void node_impl::on_announce(msg const& m, msg& reply)
|
|||
return;
|
||||
}
|
||||
|
||||
// the token was correct. That means this
|
||||
// node is not spoofing its address. So, let
|
||||
// the table get a chance to add it.
|
||||
m_table.node_seen(m.id, m.addr);
|
||||
|
||||
torrent_entry& v = m_map[m.info_hash];
|
||||
peer_entry e;
|
||||
e.addr = tcp::endpoint(m.addr.address(), m.addr.port());
|
||||
|
|
|
@ -1269,11 +1269,14 @@ namespace libtorrent
|
|||
d->resume_data = resume_data;
|
||||
|
||||
#ifndef TORRENT_DISABLE_DHT
|
||||
torrent_info::nodes_t const& nodes = ti.nodes();
|
||||
std::for_each(nodes.begin(), nodes.end(), bind(
|
||||
(void(dht::dht_tracker::*)(std::pair<std::string, int> const&))
|
||||
&dht::dht_tracker::add_node
|
||||
, boost::ref(m_impl.m_dht), _1));
|
||||
if (m_impl.m_dht)
|
||||
{
|
||||
torrent_info::nodes_t const& nodes = ti.nodes();
|
||||
std::for_each(nodes.begin(), nodes.end(), bind(
|
||||
(void(dht::dht_tracker::*)(std::pair<std::string, int> const&))
|
||||
&dht::dht_tracker::add_node
|
||||
, boost::ref(m_impl.m_dht), _1));
|
||||
}
|
||||
#endif
|
||||
|
||||
// add the torrent to the queue to be checked
|
||||
|
|
Loading…
Reference in New Issue