mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-21 13:10:08 +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:
@@ -661,7 +661,7 @@ static RPCHelpMan getnetworkinfo()
|
||||
for (const std::pair<const CNetAddr, LocalServiceInfo> &item : mapLocalHost)
|
||||
{
|
||||
UniValue rec(UniValue::VOBJ);
|
||||
rec.pushKV("address", item.first.ToString());
|
||||
rec.pushKV("address", item.first.ToStringAddr());
|
||||
rec.pushKV("port", item.second.nPort);
|
||||
rec.pushKV("score", item.second.nScore);
|
||||
localAddresses.push_back(rec);
|
||||
|
||||
Reference in New Issue
Block a user