From 97217a1fd60410243863cea7a45f71e904232f15 Mon Sep 17 00:00:00 2001 From: Thomas Yuan Date: Wed, 2 Sep 2015 12:28:37 -0400 Subject: [PATCH] A node with an invalid node_id, shouldn't be added to routing table. --- src/kademlia/routing_table.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/kademlia/routing_table.cpp b/src/kademlia/routing_table.cpp index 1c1b41495..52427e842 100644 --- a/src/kademlia/routing_table.cpp +++ b/src/kademlia/routing_table.cpp @@ -1106,6 +1106,8 @@ void routing_table::add_router_node(udp::endpoint router) // pinged == false) 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)); }