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:
parent
8c3621cead
commit
ff130e2b5e
3 changed files with 9 additions and 5 deletions
|
@ -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…
Reference in a new issue