mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
Merge #15343: [doc] netaddress: Make IPv4 loopback comment more descriptive
87aa0b48af
netaddress: Make IPv4 loopback comment more descriptive (Carl Dong)6180b5f32b
netaddress: Fix indentation in IsLocal (Carl Dong) Pull request description: This also makes the comment match the IPv6 comment just below this hunk. Tree-SHA512: 9b91195e71e18156c9e013f63a6d430c67951aabb4a0c2f48f3bf852570c13887572b9e2fa52f4e1beba8685a9cae8949d4d03cd618a78f88566cf9e85dc64a8
This commit is contained in:
commit
72d34c0edc
1 changed files with 8 additions and 8 deletions
|
@ -182,16 +182,16 @@ bool CNetAddr::IsTor() const
|
|||
|
||||
bool CNetAddr::IsLocal() const
|
||||
{
|
||||
// IPv4 loopback
|
||||
if (IsIPv4() && (GetByte(3) == 127 || GetByte(3) == 0))
|
||||
return true;
|
||||
// IPv4 loopback (127.0.0.0/8 or 0.0.0.0/8)
|
||||
if (IsIPv4() && (GetByte(3) == 127 || GetByte(3) == 0))
|
||||
return true;
|
||||
|
||||
// IPv6 loopback (::1/128)
|
||||
static const unsigned char pchLocal[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1};
|
||||
if (memcmp(ip, pchLocal, 16) == 0)
|
||||
return true;
|
||||
// IPv6 loopback (::1/128)
|
||||
static const unsigned char pchLocal[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1};
|
||||
if (memcmp(ip, pchLocal, 16) == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CNetAddr::IsValid() const
|
||||
|
|
Loading…
Add table
Reference in a new issue