llarp::BootstrapConfig update

* make routers member a llarp::BootstrapList
pull/1748/head
Jeff Becker 3 years ago committed by Jeff
parent c4b1a9c074
commit 2428cc189e

@ -1,6 +1,7 @@
#pragma once
#include <chrono>
#include <llarp/bootstrap.hpp>
#include <llarp/crypto/types.hpp>
#include <llarp/router_contact.hpp>
#include <llarp/util/fs.hpp>
@ -196,7 +197,7 @@ namespace llarp
struct BootstrapConfig
{
std::vector<fs::path> files;
std::set<RouterContact> routers;
BootstrapList routers;
bool seednode;
void
defineConfigOptions(ConfigDefinition& conf, const ConfigGenParameters& params);

@ -240,15 +240,13 @@ extern "C"
llarp::CryptoManager instance{new llarp::sodium::CryptoLibSodium{}};
if (data[0] == 'l')
{
llarp::BootstrapList routers{};
if (not routers.BDecode(&buf))
if (not ctx->config->bootstrap.routers.BDecode(&buf))
return -1;
for (const auto& rc : routers)
for (const auto& rc : ctx->config.bootstrap.routers)
{
if (not rc.Verify(llarp::time_now_ms()))
return -2;
}
ctx->config->bootstrap.routers = std::move(routers);
}
else
{

Loading…
Cancel
Save