aboutsummaryrefslogtreecommitdiff
path: root/src/netaddress.cpp
diff options
context:
space:
mode:
authorJon Atack <[email protected]>2020-02-05 15:49:33 +0100
committerJon Atack <[email protected]>2020-03-04 14:31:31 +0100
commitc90b9a2399f4cead37bad39f388ce1255e123dc4 (patch)
treee3ceb49cd811ee5aa0f251881bccfff8df0953bc /src/netaddress.cpp
parentlogging: asmap logging and #include fixups (diff)
downloaddiscoin-c90b9a2399f4cead37bad39f388ce1255e123dc4.tar.xz
discoin-c90b9a2399f4cead37bad39f388ce1255e123dc4.zip
net: extract conditional to bool CNetAddr::IsHeNet
and remove redundant public declaration
Diffstat (limited to 'src/netaddress.cpp')
-rw-r--r--src/netaddress.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/netaddress.cpp b/src/netaddress.cpp
index 1cac57a81..228caf74a 100644
--- a/src/netaddress.cpp
+++ b/src/netaddress.cpp
@@ -210,6 +210,11 @@ bool CNetAddr::IsRFC7343() const
return (GetByte(15) == 0x20 && GetByte(14) == 0x01 && GetByte(13) == 0x00 && (GetByte(12) & 0xF0) == 0x20);
}
+bool CNetAddr::IsHeNet() const
+{
+ return (GetByte(15) == 0x20 && GetByte(14) == 0x01 && GetByte(13) == 0x04 && GetByte(12) == 0x70);
+}
+
/**
* @returns Whether or not this is a dummy address that maps an onion address
* into IPv6.
@@ -516,7 +521,7 @@ std::vector<unsigned char> CNetAddr::GetGroup(const std::vector<bool> &asmap) co
} else if (IsTor()) {
nStartByte = 6;
nBits = 4;
- } else if (GetByte(15) == 0x20 && GetByte(14) == 0x01 && GetByte(13) == 0x04 && GetByte(12) == 0x70) {
+ } else if (IsHeNet()) {
// for he.net, use /36 groups
nBits = 36;
} else {