decay profiles unconditionally

pull/523/head
Jeff Becker 5 years ago
parent 76c5601894
commit 05dc2fb679
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -329,7 +329,8 @@ namespace llarp
if(left)
return;
Context* ctx = static_cast< Context* >(u);
const auto num = std::min(ctx->router->NumberOfConnectedRouters(), size_t(4));
const auto num =
std::min(ctx->router->NumberOfConnectedRouters(), size_t(4));
if(num)
ctx->Explore(num);
ctx->router->logic()->call_later({orig, ctx, &handle_explore_timer});

@ -52,7 +52,7 @@ namespace llarp
connectTimeoutCount /= 2;
pathSuccessCount /= 2;
pathFailCount /= 2;
lastUpdated = llarp::time_now_ms();
lastDecay = llarp::time_now_ms();
}
void
@ -60,11 +60,9 @@ namespace llarp
{
// 15 seconds
static constexpr llarp_time_t updateInterval = 15 * 1000;
auto now = llarp::time_now_ms();
if(lastUpdated < now && now - lastUpdated > updateInterval)
{
const auto now = llarp::time_now_ms();
if(lastDecay < now && now - lastDecay > updateInterval)
Decay();
}
}
bool

@ -19,6 +19,7 @@ namespace llarp
uint64_t pathSuccessCount = 0;
uint64_t pathFailCount = 0;
llarp_time_t lastUpdated = 0;
llarp_time_t lastDecay = 0;
RouterProfile() : IBEncodeMessage(){};

Loading…
Cancel
Save