aboutsummaryrefslogtreecommitdiff
path: root/src/netbase.cpp
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2020-10-12 09:31:08 +0200
committerJon Atack <jon@atack.com>2020-10-15 19:21:38 +0200
commitba8997fb2eda73603ce457bfec668cb7e0acbc89 (patch)
tree4bc4ddbc6927585f3fc148b6f2afcd033ca048c2 /src/netbase.cpp
parent0d22482353752ebfb11aa29f4b26113b817a448a (diff)
net: update GetNetworkName() with all enum Network cases
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r--src/netbase.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp
index 0273839017..264029d8a2 100644
--- a/src/netbase.cpp
+++ b/src/netbase.cpp
@@ -52,14 +52,20 @@ enum Network ParseNetwork(const std::string& net_in) {
return NET_UNROUTABLE;
}
-std::string GetNetworkName(enum Network net) {
- switch(net)
- {
+std::string GetNetworkName(enum Network net)
+{
+ switch (net) {
+ case NET_UNROUTABLE: return "unroutable";
case NET_IPV4: return "ipv4";
case NET_IPV6: return "ipv6";
case NET_ONION: return "onion";
- default: return "";
- }
+ case NET_I2P: return "i2p";
+ case NET_CJDNS: return "cjdns";
+ case NET_INTERNAL: return "internal";
+ case NET_MAX: assert(false);
+ } // no default case, so the compiler can warn about missing cases
+
+ assert(false);
}
bool static LookupIntern(const std::string& name, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions, bool fAllowLookup)