fix bootstrap

(cherry picked from commit 8ee36d71ff)
This commit is contained in:
Jeff Becker 2018-12-18 12:37:59 -05:00 committed by Ryan Tharp
parent db6945b6a0
commit 261254ce2b
1 changed files with 18 additions and 17 deletions

View File

@ -660,25 +660,26 @@ namespace llarp
}
}
size_t N = nodedb->num_loaded();
if(N < minRequiredRouters)
{
llarp::LogInfo("We need at least ", minRequiredRouters,
" service nodes to build paths but we have ", N);
// TODO: only connect to random subset
if(bootstrapRCList.size())
{
for(const auto &rc : bootstrapRCList)
{
llarp_router_try_connect(this, rc, 4);
dht->impl.ExploreNetworkVia(rc.pubkey.data());
}
}
else
llarp::LogError("we have no bootstrap nodes specified");
}
if(inboundLinks.size() == 0)
{
size_t N = nodedb->num_loaded();
if(N < minRequiredRouters)
{
llarp::LogInfo("We need at least ", minRequiredRouters,
" service nodes to build paths but we have ", N);
// TODO: only connect to random subset
if(bootstrapRCList.size())
{
for(const auto &rc : bootstrapRCList)
{
llarp_router_try_connect(this, rc, 4);
dht->impl.ExploreNetworkVia(rc.pubkey.data());
}
}
else
llarp::LogError("we have no bootstrap nodes specified");
}
paths.BuildPaths(now);
hiddenServiceContext.Tick(now);
}