mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
scripted-diff: rename ToStringIP[Port]() to ToStringAddr[Port]()
"IP" stands for "Internet Protocol". "IP address" is sometimes shortened to just "IP" or "address". However, Tor or I2P addresses are not "IP addresses", nor "IPs". Thus, use "Addr" instead of "IP" for addresses that could be IP, Tor or I2P addresses: `CService::ToStringIPPort()` -> `CService::ToStringAddrPort()` `CNetAddr::ToStringIP()` -> `CNetAddr::ToStringAddr()` -BEGIN VERIFY SCRIPT- sed -i 's/ToStringIPPort/ToStringAddrPort/g' -- $(git grep -l ToStringIPPort src) sed -i 's/ToStringIP/ToStringAddr/g' -- $(git grep -l ToStringIP src) -END VERIFY SCRIPT-
This commit is contained in:
@@ -599,7 +599,7 @@ std::string OnionToString(Span<const uint8_t> addr)
|
||||
return EncodeBase32(address) + ".onion";
|
||||
}
|
||||
|
||||
std::string CNetAddr::ToStringIP() const
|
||||
std::string CNetAddr::ToStringAddr() const
|
||||
{
|
||||
switch (m_net) {
|
||||
case NET_IPV4:
|
||||
@@ -624,7 +624,7 @@ std::string CNetAddr::ToStringIP() const
|
||||
|
||||
std::string CNetAddr::ToString() const
|
||||
{
|
||||
return ToStringIP();
|
||||
return ToStringAddr();
|
||||
}
|
||||
|
||||
bool operator==(const CNetAddr& a, const CNetAddr& b)
|
||||
@@ -921,18 +921,18 @@ std::string CService::ToStringPort() const
|
||||
return strprintf("%u", port);
|
||||
}
|
||||
|
||||
std::string CService::ToStringIPPort() const
|
||||
std::string CService::ToStringAddrPort() const
|
||||
{
|
||||
if (IsIPv4() || IsTor() || IsI2P() || IsInternal()) {
|
||||
return ToStringIP() + ":" + ToStringPort();
|
||||
return ToStringAddr() + ":" + ToStringPort();
|
||||
} else {
|
||||
return "[" + ToStringIP() + "]:" + ToStringPort();
|
||||
return "[" + ToStringAddr() + "]:" + ToStringPort();
|
||||
}
|
||||
}
|
||||
|
||||
std::string CService::ToString() const
|
||||
{
|
||||
return ToStringIPPort();
|
||||
return ToStringAddrPort();
|
||||
}
|
||||
|
||||
CSubNet::CSubNet():
|
||||
|
||||
Reference in New Issue
Block a user