net: remove CService::ToStringPort()

It is used only internally in `CService::ToStringAddrPort()`.
This commit is contained in:
Vasil Dimov
2022-07-15 17:56:30 +02:00
parent fd4f0f41e9
commit c9d548c91f
3 changed files with 4 additions and 9 deletions

View File

@@ -911,17 +911,14 @@ std::vector<unsigned char> CService::GetKey() const
return key;
}
std::string CService::ToStringPort() const
{
return strprintf("%u", port);
}
std::string CService::ToStringAddrPort() const
{
const auto port_str = strprintf("%u", port);
if (IsIPv4() || IsTor() || IsI2P() || IsInternal()) {
return ToStringAddr() + ":" + ToStringPort();
return ToStringAddr() + ":" + port_str;
} else {
return "[" + ToStringAddr() + "]:" + ToStringPort();
return "[" + ToStringAddr() + "]:" + port_str;
}
}