track lookup fails and kill outbound context if too many

pull/421/head
Jeff Becker 5 years ago
parent 79214ae5c3
commit f5b9bd40ed
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -1227,6 +1227,8 @@ namespace llarp
else
SwapIntros();
}
else
++m_LookupFails;
return true;
}
@ -1770,6 +1772,9 @@ namespace llarp
bool
Endpoint::OutboundContext::Tick(llarp_time_t now)
{
// we are probably dead af
if(m_LookupFails > 16)
return true;
// check for expiration
if(remoteIntro.ExpiresSoon(now))
{

@ -355,6 +355,7 @@ namespace llarp
std::unordered_map< Introduction, llarp_time_t, Introduction::Hash >
m_BadIntros;
llarp_time_t lastShift = 0;
uint16_t m_LookupFails = 0;
};
// passed a sendto context when we have a path established otherwise

Loading…
Cancel
Save