A node with an invalid node_id, shouldn't be added to routing table.

This commit is contained in:
Thomas Yuan 2015-09-02 12:28:37 -04:00
parent cc29a99c90
commit 97217a1fd6
1 changed files with 2 additions and 0 deletions

View File

@ -1106,6 +1106,8 @@ void routing_table::add_router_node(udp::endpoint router)
// pinged == false) // pinged == false)
void routing_table::heard_about(node_id const& id, udp::endpoint const& ep) void routing_table::heard_about(node_id const& id, udp::endpoint const& ep)
{ {
// only when the node_id pass the verification, add it to routing table.
if (m_settings.enforce_node_id && !verify_id(id, ep.address())) return;
add_node(node_entry(id, ep)); add_node(node_entry(id, ep));
} }