Don't respect whitelist when we haven't received it yet

pull/1041/head
Stephen Shelton 4 years ago
parent c92e7ae5c7
commit 8206557ac7
No known key found for this signature in database
GPG Key ID: 09082714F73FAA22

@ -49,6 +49,13 @@ namespace llarp
" routers");
}
bool
RCLookupHandler::HaveReceivedWhitelist()
{
util::Lock l(&_mutex);
return whitelistRouters.empty();
}
void
RCLookupHandler::GetRC(const RouterID &router, RCRequestCallback callback,
bool forceLookup)

@ -40,6 +40,9 @@ namespace llarp
SetRouterWhitelist(const std::vector< RouterID > &routers) override
LOCKS_EXCLUDED(_mutex);
bool
HaveReceivedWhitelist();
void
GetRC(const RouterID &router, RCRequestCallback callback,
bool forceLookup = false) override LOCKS_EXCLUDED(_mutex);

@ -679,7 +679,7 @@ namespace llarp
LogError("Failed to update our RC");
}
if(isSvcNode)
if(isSvcNode && _rcLookupHandler.HaveReceivedWhitelist())
{
// remove RCs for nodes that are no longer allowed by network policy
nodedb()->RemoveIf([&](const RouterContact &rc) -> bool {

Loading…
Cancel
Save