netinfo: add ConnectionTypeForNetinfo member helper function

This commit is contained in:
Jon Atack 2020-12-24 18:09:02 +01:00
parent 384e090f93
commit 62bf5b7850
No known key found for this signature in database
GPG key ID: 4F5721B3D0E3921D

View file

@ -351,6 +351,14 @@ private:
const double milliseconds{round(1000 * seconds)};
return milliseconds > 999999 ? "-" : ToString(milliseconds);
}
std::string ConnectionTypeForNetinfo(const std::string& conn_type) const
{
if (conn_type == "outbound-full-relay") return "full";
if (conn_type == "block-relay-only") return "block";
if (conn_type == "manual" || conn_type == "feeler") return conn_type;
if (conn_type == "addr-fetch") return "addr";
return "";
}
const UniValue NetinfoHelp()
{
return std::string{