Merge pull request #1623 from majestrate/dont-use-non-tested-paths-2021-05-03

dont use non tested paths
pull/1625/head
Jeff 3 years ago committed by GitHub
commit 26e182955c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -131,7 +131,7 @@ namespace llarp
m_Resolver->Restart(); m_Resolver->Restart();
} }
constexpr auto DefaultAlignmentTimeout = 10s; constexpr auto DefaultAlignmentTimeout = 15s;
bool bool
TunEndpoint::Configure(const NetworkConfig& conf, const DnsConfig& dnsConf) TunEndpoint::Configure(const NetworkConfig& conf, const DnsConfig& dnsConf)

@ -156,7 +156,8 @@ namespace llarp
{ {
if (chosen == nullptr) if (chosen == nullptr)
chosen = itr->second; chosen = itr->second;
else if (chosen->intro.latency > itr->second->intro.latency) else if (
chosen->intro.latency != 0s and chosen->intro.latency > itr->second->intro.latency)
chosen = itr->second; chosen = itr->second;
} }
} }
@ -429,7 +430,7 @@ namespace llarp
llarp_time_t minLatency = 30s; llarp_time_t minLatency = 30s;
for (const auto& path : established) for (const auto& path : established)
{ {
if (path->intro.latency < minLatency) if (path->intro.latency < minLatency and path->intro.latency != 0s)
{ {
minLatency = path->intro.latency; minLatency = path->intro.latency;
chosen = path; chosen = path;

Loading…
Cancel
Save