netinfo: add ConnectionTypeForNetinfo member helper function

This commit is contained in:
Jon Atack committed 2021-02-02 15:22:22 +01:00
1 parent 384e090f93
commit 62bf5b7850
1 file changed
+8
+8
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{