mirror of https://github.com/oxen-io/lokinet
simplify logic
This commit is contained in:
parent
327ab6f178
commit
d8da3f0a83
|
@ -726,25 +726,16 @@ namespace llarp
|
|||
GossipRCIfNeeded(_rc);
|
||||
}
|
||||
|
||||
if(isSvcNode && _rcLookupHandler.HaveReceivedWhitelist())
|
||||
{
|
||||
// remove RCs for nodes that are no longer allowed by network policy
|
||||
nodedb()->RemoveIf([&](const RouterContact &rc) -> bool {
|
||||
if(IsBootstrapNode(rc.pubkey))
|
||||
return false;
|
||||
if(not rc.IsPublicRouter())
|
||||
return true;
|
||||
return !_rcLookupHandler.RemoteIsAllowed(rc.pubkey);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
nodedb()->RemoveIf([&](const RouterContact &rc) -> bool {
|
||||
if(IsBootstrapNode(rc.pubkey))
|
||||
return false;
|
||||
return not rc.IsPublicRouter();
|
||||
});
|
||||
}
|
||||
// remove RCs for nodes that are no longer allowed by network policy
|
||||
nodedb()->RemoveIf([&](const RouterContact &rc) -> bool {
|
||||
if(IsBootstrapNode(rc.pubkey))
|
||||
return false;
|
||||
if(not rc.IsPublicRouter())
|
||||
return true;
|
||||
if(not isSvcNode)
|
||||
return false;
|
||||
return not _rcLookupHandler.RemoteIsAllowed(rc.pubkey);
|
||||
});
|
||||
|
||||
_linkManager.CheckPersistingSessions(now);
|
||||
|
||||
|
|
Loading…
Reference in New Issue