mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 18:53:23 -03:00
netinfo: add ConnectionTypeForNetinfo member helper function
This commit is contained in:
parent
384e090f93
commit
62bf5b7850
1 changed files with 8 additions and 0 deletions
|
@ -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{
|
||||
|
|
Loading…
Add table
Reference in a new issue