mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-11 07:10:36 +00:00
dont flood dht with requests, if we know of a router don't look it up
This commit is contained in:
parent
e44449b2d5
commit
cd27b33849
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user