simplify logic

pull/1171/head
Jeff Becker 4 years ago
parent 327ab6f178
commit d8da3f0a83
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -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…
Cancel
Save