die if we are a relay and don't have any inbound links

pull/1319/head
Jeff Becker 4 years ago
parent 8c3621cead
commit ff130e2b5e
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -143,6 +143,7 @@ namespace llarp
else
{
m_enablePeerStats = true;
m_isRelay = true;
}
}

@ -63,6 +63,7 @@ namespace llarp
std::string m_transportKeyFile;
bool m_enablePeerStats = false;
bool m_isRelay = false;
void
defineConfigOptions(ConfigDefinition& conf, const ConfigGenParameters& params);

@ -449,11 +449,7 @@ namespace llarp
if (usingSNSeed)
ident_keyfile = conf.lokid.ident_keyfile;
// TODO: add config flag for "is service node"
if (conf.links.m_InboundLinks.size())
{
m_isServiceNode = true;
}
m_isServiceNode = conf.router.m_isRelay;
networkConfig = conf.network;
@ -966,6 +962,12 @@ namespace llarp
}
});
if (IsServiceNode() and not _rc.IsPublicRouter())
{
LogError("we are configured as relay but have no reachable addresses");
return false;
}
// set public encryption key
_rc.enckey = seckey_topublic(encryption());

Loading…
Cancel
Save