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 authored and furszy committed Aug 10, 2021
1 parent 647d60b commit 57fc7b0
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/netbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@ enum Network ParseNetwork(std::string net)
std::string GetNetworkName(enum Network net)
{
switch (net) {
case NET_IPV4:
return "ipv4";
case NET_IPV6:
return "ipv6";
case NET_ONION:
return "onion";
default:
return "";
}
case NET_UNROUTABLE: return "unroutable";
case NET_IPV4: return "ipv4";
case NET_IPV6: return "ipv6";
case NET_ONION: return "onion";
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);
}

void SplitHostPort(std::string in, int& portOut, std::string& hostOut)
Expand Down

0 comments on commit 57fc7b0

Please sign in to comment.