mirror of https://github.com/oxen-io/lokinet
don't use profiling if service node
This commit is contained in:
parent
5cbfccfff4
commit
94ad765b8e
|
@ -66,8 +66,11 @@ struct TryConnectJob
|
|||
Attempt();
|
||||
return;
|
||||
}
|
||||
if(router->routerProfiling.IsBad(rc.pubkey))
|
||||
llarp_nodedb_del_rc(router->nodedb, rc.pubkey);
|
||||
if(!router->IsServiceNode())
|
||||
{
|
||||
if(router->routerProfiling.IsBad(rc.pubkey))
|
||||
llarp_nodedb_del_rc(router->nodedb, rc.pubkey);
|
||||
}
|
||||
// delete this
|
||||
router->pendingEstablishJobs.erase(rc.pubkey);
|
||||
}
|
||||
|
@ -326,6 +329,12 @@ llarp_router::SaveRC()
|
|||
return rc().Write(our_rc_file.string().c_str());
|
||||
}
|
||||
|
||||
bool
|
||||
llarp_router::IsServiceNode() const
|
||||
{
|
||||
return inboundLinks.size() > 0;
|
||||
}
|
||||
|
||||
void
|
||||
llarp_router::Close()
|
||||
{
|
||||
|
@ -424,7 +433,7 @@ llarp_router::TryEstablishTo(const llarp::RouterID &remote)
|
|||
// try connecting async
|
||||
llarp_router_try_connect(this, rc, 5);
|
||||
}
|
||||
else if(!routerProfiling.IsBad(remote))
|
||||
else if(IsServiceNode() || !routerProfiling.IsBad(remote))
|
||||
{
|
||||
if(dht->impl.HasRouterLookup(remote))
|
||||
return;
|
||||
|
@ -457,7 +466,8 @@ llarp_router::HandleDHTLookupForTryEstablishTo(
|
|||
{
|
||||
if(results.size() == 0)
|
||||
{
|
||||
routerProfiling.MarkTimeout(remote);
|
||||
if(!IsServiceNode())
|
||||
routerProfiling.MarkTimeout(remote);
|
||||
}
|
||||
for(const auto &result : results)
|
||||
{
|
||||
|
|
|
@ -186,6 +186,10 @@ struct llarp_router
|
|||
bool
|
||||
InitServiceNode();
|
||||
|
||||
/// return true if we are running in service node mode
|
||||
bool
|
||||
IsServiceNode() const;
|
||||
|
||||
void
|
||||
Close();
|
||||
|
||||
|
|
Loading…
Reference in New Issue