diff options
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r-- | src/netbase.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp index f9f4755f7b..4e109a8bc9 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -51,6 +51,16 @@ enum Network ParseNetwork(std::string net) { return NET_UNROUTABLE; } +std::string GetNetworkName(enum Network net) { + switch(net) + { + case NET_IPV4: return "ipv4"; + case NET_IPV6: return "ipv6"; + case NET_TOR: return "onion"; + default: return ""; + } +} + void SplitHostPort(std::string in, int &portOut, std::string &hostOut) { size_t colon = in.find_last_of(':'); // if a : is found, and it either follows a [...], or no other : is in the string, treat it as port separator |