Increase default path timeout from 10min to 20min

pull/1127/head
Stephen Shelton 5 years ago
parent f0374eb2b7
commit 230037b9f3
No known key found for this signature in database
GPG Key ID: EE4BADACCE8B631C

@ -17,7 +17,7 @@ namespace llarp
/// pad messages to the nearest this many bytes /// pad messages to the nearest this many bytes
constexpr std::size_t pad_size = 128; constexpr std::size_t pad_size = 128;
/// default path lifetime in ms /// default path lifetime in ms
static constexpr auto default_lifetime = 10min; static constexpr auto default_lifetime = 20min;
/// after this many ms a path build times out /// after this many ms a path build times out
static constexpr auto build_timeout = 30s; static constexpr auto build_timeout = 30s;

@ -75,10 +75,10 @@ namespace llarp
Endpoint::RegenAndPublishIntroSet(bool forceRebuild) Endpoint::RegenAndPublishIntroSet(bool forceRebuild)
{ {
const auto now = llarp::time_now_ms(); const auto now = llarp::time_now_ms();
std::set< Introduction > I; std::set< Introduction > introset;
if(!GetCurrentIntroductionsWithFilter( if(!GetCurrentIntroductionsWithFilter(
I, [now](const service::Introduction& intro) -> bool { introset, [now](const service::Introduction& intro) -> bool {
return not intro.ExpiresSoon(now, 2min); return not intro.ExpiresSoon(now, path::default_lifetime * 2);
})) }))
{ {
LogWarn("could not publish descriptors for endpoint ", Name(), LogWarn("could not publish descriptors for endpoint ", Name(),
@ -88,7 +88,7 @@ namespace llarp
return; return;
} }
introSet().I.clear(); introSet().I.clear();
for(auto& intro : I) for(auto& intro : introset)
{ {
introSet().I.emplace_back(std::move(intro)); introSet().I.emplace_back(std::move(intro));
} }

Loading…
Cancel
Save