change assert to throw an exception instead when service node has no peer stats enable.

update unit tests so it passes on debian sid
pull/1319/head
jeff 4 years ago
parent 52d20968a7
commit 75f550434c

@ -623,9 +623,9 @@ namespace llarp
m_peerDb = std::make_shared<PeerDb>();
m_peerDb->configure(conf.router);
}
else
else if(IsServiceNode())
{
assert(not IsServiceNode()); // enable peer stats must be enabled for service nodes
throw std::runtime_error("peer stats must be enabled when running as relay");
}
// Logging config

@ -11,13 +11,14 @@ static const llarp::RuntimeOptions opts = {.background = false, .debug = false,
std::shared_ptr<llarp::Context>
make_context()
{
llarp::Config conf;
llarp::Config conf{};
conf.LoadDefault(true, fs::current_path());
// set testing defaults
conf.network.m_endpointType = "null";
conf.bootstrap.skipBootstrap = true;
conf.api.m_enableRPCServer = false;
conf.router.m_enablePeerStats = true;
conf.router.m_publicAddress = llarp::IpAddress("1.1.1.1");
// make a fake inbound link
conf.links.m_InboundLinks.emplace_back();

Loading…
Cancel
Save