mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
net: remove CService::ToStringPort()
It is used only internally in `CService::ToStringAddrPort()`.
This commit is contained in:
parent
fd4f0f41e9
commit
c9d548c91f
3 changed files with 4 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -535,7 +535,6 @@ public:
|
|||
friend bool operator!=(const CService& a, const CService& b) { return !(a == b); }
|
||||
friend bool operator<(const CService& a, const CService& b);
|
||||
std::vector<unsigned char> GetKey() const;
|
||||
std::string ToStringPort() const;
|
||||
std::string ToStringAddrPort() const;
|
||||
|
||||
CService(const struct in6_addr& ipv6Addr, uint16_t port);
|
||||
|
|
|
@ -80,7 +80,6 @@ FUZZ_TARGET(netaddress)
|
|||
(void)service.GetKey();
|
||||
(void)service.GetPort();
|
||||
(void)service.ToStringAddrPort();
|
||||
(void)service.ToStringPort();
|
||||
(void)CServiceHash()(service);
|
||||
(void)CServiceHash(0, 0)(service);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue