dont flood dht with requests, if we know of a router don't look it up

This commit is contained in:
Jeff Becker 2020-02-07 13:19:00 -05:00
parent e44449b2d5
commit cd27b33849
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

View File

@ -4,6 +4,8 @@
#include <dht/messages/findrouter.hpp> #include <dht/messages/findrouter.hpp>
#include <router/abstractrouter.hpp> #include <router/abstractrouter.hpp>
#include <nodedb.hpp>
namespace llarp namespace llarp
{ {
namespace dht namespace dht
@ -24,6 +26,8 @@ namespace llarp
for(const auto &pk : valuesFound) for(const auto &pk : valuesFound)
{ {
// lookup router // lookup router
if(router->nodedb()->Has(pk))
continue;
parent->LookupRouter( parent->LookupRouter(
pk, pk,
std::bind(&AbstractRouter::HandleDHTLookupForExplore, router, pk, std::bind(&AbstractRouter::HandleDHTLookupForExplore, router, pk,