aboutsummaryrefslogtreecommitdiff
path: root/src/netaddress.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/netaddress.cpp')
-rw-r--r--src/netaddress.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/netaddress.cpp b/src/netaddress.cpp
index 5ccbabd03d..193582d14e 100644
--- a/src/netaddress.cpp
+++ b/src/netaddress.cpp
@@ -300,6 +300,9 @@ bool CNetAddr::GetInAddr(struct in_addr* pipv4Addr) const
bool CNetAddr::GetIn6Addr(struct in6_addr* pipv6Addr) const
{
+ if (!IsIPv6()) {
+ return false;
+ }
memcpy(pipv6Addr, ip, 16);
return true;
}