aboutsummaryrefslogtreecommitdiff
path: root/src/netaddress.cpp
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2021-04-22 15:52:03 +0000
committerpracticalswift <practicalswift@users.noreply.github.com>2021-04-22 15:52:14 +0000
commit54548bae8004a8f49d73bd29aeca8b41894214c4 (patch)
treee8b11060d4ea9a05f5387b9708df4ec62fea1657 /src/netaddress.cpp
parentc10f27fdb2d335954dd1017ce6d5800159427374 (diff)
net: Avoid calling getnameinfo when formatting IPv6 addresses in CNetAddr::ToStringIP
Diffstat (limited to 'src/netaddress.cpp')
-rw-r--r--src/netaddress.cpp9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/netaddress.cpp b/src/netaddress.cpp
index cbccb0a8a9..112e216c09 100644
--- a/src/netaddress.cpp
+++ b/src/netaddress.cpp
@@ -615,15 +615,6 @@ std::string CNetAddr::ToStringIP() const
case NET_IPV4:
return IPv4ToString(m_addr);
case NET_IPV6: {
- CService serv(*this, 0);
- struct sockaddr_storage sockaddr;
- socklen_t socklen = sizeof(sockaddr);
- if (serv.GetSockAddr((struct sockaddr*)&sockaddr, &socklen)) {
- char name[1025] = "";
- if (!getnameinfo((const struct sockaddr*)&sockaddr, socklen, name,
- sizeof(name), nullptr, 0, NI_NUMERICHOST))
- return std::string(name);
- }
return IPv6ToString(m_addr);
}
case NET_ONION: