|
|
|
@ -982,6 +982,7 @@ namespace llarp
|
|
|
|
|
llarp_time_t /*timeoutMS*/)
|
|
|
|
|
{
|
|
|
|
|
static constexpr size_t NumParalellLookups = 2;
|
|
|
|
|
static constexpr size_t RequestsPerLookup = 2;
|
|
|
|
|
LogInfo(Name(), " Ensure Path to ", remote.ToString());
|
|
|
|
|
|
|
|
|
|
MarkAddressOutbound(remote);
|
|
|
|
@ -1005,13 +1006,17 @@ namespace llarp
|
|
|
|
|
using namespace std::placeholders;
|
|
|
|
|
size_t lookedUp = 0;
|
|
|
|
|
const dht::Key_t location = remote.ToKey();
|
|
|
|
|
uint64_t order = 0;
|
|
|
|
|
for(const auto& path : paths)
|
|
|
|
|
{
|
|
|
|
|
for(size_t count = 0; count < RequestsPerLookup; ++count)
|
|
|
|
|
{
|
|
|
|
|
HiddenServiceAddressLookup* job = new HiddenServiceAddressLookup(
|
|
|
|
|
this, util::memFn(&Endpoint::OnLookup, this), location,
|
|
|
|
|
PubKey{remote.as_array()}, 0, GenTXID());
|
|
|
|
|
LogInfo("doing lookup for ", remote, " via ", path->Endpoint(), " at ",
|
|
|
|
|
location);
|
|
|
|
|
PubKey{remote.as_array()}, order, GenTXID());
|
|
|
|
|
LogInfo("doing lookup for ", remote, " via ", path->Endpoint(),
|
|
|
|
|
" at ", location, " order=", order);
|
|
|
|
|
order++;
|
|
|
|
|
if(job->SendRequestViaPath(path, Router()))
|
|
|
|
|
{
|
|
|
|
|
lookups.emplace(remote, hook);
|
|
|
|
@ -1020,7 +1025,8 @@ namespace llarp
|
|
|
|
|
else
|
|
|
|
|
LogError(Name(), " send via path failed for lookup");
|
|
|
|
|
}
|
|
|
|
|
return lookedUp == NumParalellLookups;
|
|
|
|
|
}
|
|
|
|
|
return lookedUp == (NumParalellLookups * RequestsPerLookup);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|