more timeout tweaks and disable profiling on service nodes

This commit is contained in:
Jeff Becker 2019-05-06 10:21:47 -04:00
parent 728c6005a3
commit 779b1f4df5
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
3 changed files with 6 additions and 9 deletions

View File

@ -527,16 +527,13 @@ namespace llarp
}
void
Context::DHTSendTo(const RouterID& peer, IMessage* msg, bool keepalive)
Context::DHTSendTo(const RouterID& peer, IMessage* msg, bool)
{
llarp::DHTImmediateMessage m;
m.msgs.emplace_back(msg);
router->SendToOrQueue(peer, &m);
if(keepalive)
{
auto now = Now();
router->PersistSessionUntil(peer, now + 10000);
}
auto now = Now();
router->PersistSessionUntil(peer, now + 60000);
}
bool

View File

@ -50,12 +50,10 @@ namespace llarp
bool
BaseSession::ShouldBuildMore(llarp_time_t now) const
{
if(!path::Builder::ShouldBuildMore(now))
return false;
const size_t expect = (1 + (m_NumPaths / 2));
// check 30 seconds into the future and see if we need more paths
const llarp_time_t future = now + (30 * 1000) + buildIntervalLimit;
return NumPathsExistingAt(future) < expect;
return NumPathsExistingAt(future) < expect && !BuildCooldownHit(now);
}
bool

View File

@ -1593,6 +1593,8 @@ namespace llarp
LogInfo("initalized service node: ", us);
if(minConnectedRouters < 6)
minConnectedRouters = 6;
// relays do not use profiling
routerProfiling().Disable();
}
else
{