MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / IsLocal

Method IsLocal

src/netbase.cpp:791–803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

789}
790
791bool CNetAddr::IsLocal() const
792{
793 // IPv4 loopback
794 if (IsIPv4() && (GetByte(3) == 127 || GetByte(3) == 0))
795 return true;
796
797 // IPv6 loopback (::1/128)
798 static const unsigned char pchLocal[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1};
799 if (memcmp(ip, pchLocal, 16) == 0)
800 return true;
801
802 return false;
803}
804
805bool CNetAddr::IsMulticast() const
806{

Callers 2

SendMessagesFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80

Calls

no outgoing calls

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64