Skip to content

Commit

Permalink
net: update GetNetworkName() with all enum Network cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatack committed Oct 15, 2020
1 parent 0d22482 commit ba8997f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/netbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ba8997f

Please sign in to comment.