1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

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

This commit is contained in:
Jeff Becker 2020-08-14 11:36:08 -04:00
parent 8c3621cead
commit ff130e2b5e
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05
3 changed files with 9 additions and 5 deletions

View file

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

View file

@ -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);

View file

@ -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());