mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-16 18:39:59 +01:00
net: remove CNetAddr::ToString() and use ToStringAddr() instead
Both methods do the same thing, so simplify to having just one. Further, `CService` inherits `CNetAddr` and `CService::ToString()` overrides `CNetAddr::ToString()` but the latter is not virtual which may be confusing. Avoid such a confusion by not having non-virtual methods with the same names in inheritance.
This commit is contained in:
@@ -622,11 +622,6 @@ std::string CNetAddr::ToStringAddr() const
|
||||
assert(false);
|
||||
}
|
||||
|
||||
std::string CNetAddr::ToString() const
|
||||
{
|
||||
return ToStringAddr();
|
||||
}
|
||||
|
||||
bool operator==(const CNetAddr& a, const CNetAddr& b)
|
||||
{
|
||||
return a.m_net == b.m_net && a.m_addr == b.m_addr;
|
||||
@@ -1098,7 +1093,7 @@ std::string CSubNet::ToString() const
|
||||
break;
|
||||
}
|
||||
|
||||
return network.ToString() + suffix;
|
||||
return network.ToStringAddr() + suffix;
|
||||
}
|
||||
|
||||
bool CSubNet::IsValid() const
|
||||
|
||||
Reference in New Issue
Block a user