add relayOrder awareness to introset lookups.

* only propgate fail when relay order is non zero as zero relay order often fails
pull/1658/head
Jeff Becker 3 years ago
parent 5074dd5f2b
commit 9a1a022d62
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -1381,8 +1381,8 @@ namespace llarp
{
HiddenServiceAddressLookup* job = new HiddenServiceAddressLookup(
this,
[this](auto addr, auto result, auto from, auto left) {
return OnLookup(addr, result, from, left);
[this](auto addr, auto result, auto from, auto left, auto order) {
return OnLookup(addr, result, from, left, order);
},
location,
PubKey{remote.as_array()},

@ -471,7 +471,8 @@ namespace llarp
const service::Address& addr,
std::optional<IntroSet> i,
const RouterID& endpoint,
llarp_time_t timeLeft);
llarp_time_t timeLeft,
uint64_t relayOrder);
bool
DoNetworkIsolation(bool failed);

@ -46,7 +46,7 @@ namespace llarp
found = *maybe;
}
}
return handle(remote, found, endpoint, TimeLeft(time_now_ms()));
return handle(remote, found, endpoint, TimeLeft(time_now_ms()), relayOrder);
}
std::shared_ptr<routing::IMessage>

@ -15,7 +15,7 @@ namespace llarp
uint64_t relayOrder;
const dht::Key_t location;
using HandlerFunc = std::function<bool(
const Address&, std::optional<IntroSet>, const RouterID&, llarp_time_t)>;
const Address&, std::optional<IntroSet>, const RouterID&, llarp_time_t, uint64_t)>;
HandlerFunc handle;
HiddenServiceAddressLookup(

@ -82,12 +82,17 @@ namespace llarp
remoteIntro = m_NextIntro;
m_DataHandler->PutSenderFor(currentConvoTag, currentIntroSet.addressKeys, false);
m_DataHandler->PutIntroFor(currentConvoTag, remoteIntro);
ShiftIntroRouter(m_NextIntro.router);
}
}
bool
OutboundContext::OnIntroSetUpdate(
const Address&, std::optional<IntroSet> foundIntro, const RouterID& endpoint, llarp_time_t)
const Address&,
std::optional<IntroSet> foundIntro,
const RouterID& endpoint,
llarp_time_t,
uint64_t relayOrder)
{
if (markedBad)
return true;
@ -112,8 +117,9 @@ namespace llarp
return true;
}
currentIntroSet = *foundIntro;
ShiftIntroRouter(RouterID{});
}
else
else if (relayOrder > 0)
{
++m_LookupFails;
LogWarn(Name(), " failed to look up introset, fails=", m_LookupFails);

Loading…
Cancel
Save