diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2022-07-15 13:49:17 +0200 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2022-12-12 11:48:31 +0100 |
commit | 944a9de08a00f8273e73cd28b40e46cc0eb0bad1 (patch) | |
tree | 2dbe578e6fa953d60df08ba235942173a0d51ed8 /src/netaddress.cpp | |
parent | 043b9de59aec88ae5e29daac7dc2a8b51a9414ce (diff) | |
download | bitcoin-944a9de08a00f8273e73cd28b40e46cc0eb0bad1.tar.xz |
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.
Diffstat (limited to 'src/netaddress.cpp')
-rw-r--r-- | src/netaddress.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/netaddress.cpp b/src/netaddress.cpp index 0b554dc3a2..4a7e2ef774 100644 --- a/src/netaddress.cpp +++ b/src/netaddress.cpp @@ -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 |