Merge pull request #2032 from tewinget/pinned_node_config_cleanup

clarify strict-connect usage and enforce minimum of 2 nodes
pull/2033/head
majestrate 2 years ago committed by GitHub
commit e8a27d1db3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -300,9 +300,9 @@ namespace llarp
throw std::invalid_argument{"duplicate strict connect snode: " + value};
},
Comment{
"Public key of a router which will act as a pinned first-hop. This may be used to",
"Public keys of routers which will act as pinned first-hops. This may be used to",
"provide a trusted router (consider that you are not fully anonymous with your",
"first hop).",
"first hop). This REQUIRES two or more nodes to be specified.",
});
conf.defineOption<std::string>(

@ -653,14 +653,15 @@ namespace llarp
auto& networkConfig = conf.network;
/// build a set of strictConnectPubkeys (
/// TODO: make this consistent with config -- do we support multiple strict connections
// or not?
std::unordered_set<RouterID> strictConnectPubkeys;
if (not networkConfig.m_strictConnect.empty())
{
const auto& val = networkConfig.m_strictConnect;
if (IsServiceNode())
throw std::runtime_error("cannot use strict-connect option as service node");
if (val.size() < 2)
throw std::runtime_error(
"Must specify more than one strict-connect router if using strict-connect");
strictConnectPubkeys.insert(val.begin(), val.end());
}

Loading…
Cancel
Save