aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-cli.cpp
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2020-12-24 18:09:02 +0100
committerJon Atack <jon@atack.com>2021-02-02 15:22:22 +0100
commit62bf5b785087981d9c0f8ddc8a3ceda911845a53 (patch)
treec4637e021c2b252a2c9f3073e4153b53f9e806b2 /src/bitcoin-cli.cpp
parent384e090f9345c07fa81ccafa8cd36037f3cd0813 (diff)
netinfo: add ConnectionTypeForNetinfo member helper function
Diffstat (limited to 'src/bitcoin-cli.cpp')
-rw-r--r--src/bitcoin-cli.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp
index fa41208a31..17c6d5f78b 100644
--- a/src/bitcoin-cli.cpp
+++ b/src/bitcoin-cli.cpp
@@ -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{