mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 23:09:44 -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;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CService::ToStringPort() const
|
|
||||||
{
|
|
||||||
return strprintf("%u", port);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string CService::ToStringAddrPort() const
|
std::string CService::ToStringAddrPort() const
|
||||||
{
|
{
|
||||||
|
const auto port_str = strprintf("%u", port);
|
||||||
|
|
||||||
if (IsIPv4() || IsTor() || IsI2P() || IsInternal()) {
|
if (IsIPv4() || IsTor() || IsI2P() || IsInternal()) {
|
||||||
return ToStringAddr() + ":" + ToStringPort();
|
return ToStringAddr() + ":" + port_str;
|
||||||
} else {
|
} 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) { return !(a == b); }
|
||||||
friend bool operator<(const CService& a, const CService& b);
|
friend bool operator<(const CService& a, const CService& b);
|
||||||
std::vector<unsigned char> GetKey() const;
|
std::vector<unsigned char> GetKey() const;
|
||||||
std::string ToStringPort() const;
|
|
||||||
std::string ToStringAddrPort() const;
|
std::string ToStringAddrPort() const;
|
||||||
|
|
||||||
CService(const struct in6_addr& ipv6Addr, uint16_t port);
|
CService(const struct in6_addr& ipv6Addr, uint16_t port);
|
||||||
|
|
|
@ -80,7 +80,6 @@ FUZZ_TARGET(netaddress)
|
||||||
(void)service.GetKey();
|
(void)service.GetKey();
|
||||||
(void)service.GetPort();
|
(void)service.GetPort();
|
||||||
(void)service.ToStringAddrPort();
|
(void)service.ToStringAddrPort();
|
||||||
(void)service.ToStringPort();
|
|
||||||
(void)CServiceHash()(service);
|
(void)CServiceHash()(service);
|
||||||
(void)CServiceHash(0, 0)(service);
|
(void)CServiceHash(0, 0)(service);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue