Merge pull request #1087 from majestrate/dont-flood-dht-2020-02-07

dont flood dht with requests, if we know of a router don't look it up
pull/1092/head
Jeff 5 years ago committed by GitHub
commit 8cad7fecbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 and router->nodedb()->Has(pk))
continue;
parent->LookupRouter( parent->LookupRouter(
pk, pk,
std::bind(&AbstractRouter::HandleDHTLookupForExplore, router, pk, std::bind(&AbstractRouter::HandleDHTLookupForExplore, router, pk,

Loading…
Cancel
Save