mirror of https://github.com/oxen-io/lokinet
more timeout tweaks and disable profiling on service nodes
This commit is contained in:
parent
728c6005a3
commit
779b1f4df5
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1593,6 +1593,8 @@ namespace llarp
|
|||
LogInfo("initalized service node: ", us);
|
||||
if(minConnectedRouters < 6)
|
||||
minConnectedRouters = 6;
|
||||
// relays do not use profiling
|
||||
routerProfiling().Disable();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue