Changeset View
Changeset View
Standalone View
Standalone View
src/netaddress.cpp
Show First 20 Lines • Show All 546 Lines • ▼ Show 20 Lines | std::vector<uint8_t> CNetAddr::GetGroup(const std::vector<bool> &asmap) const { | ||||
if (nBits > 0) { | if (nBits > 0) { | ||||
vchRet.push_back(GetByte(15 - nStartByte) | ((1 << (8 - nBits)) - 1)); | vchRet.push_back(GetByte(15 - nStartByte) | ((1 << (8 - nBits)) - 1)); | ||||
} | } | ||||
return vchRet; | return vchRet; | ||||
} | } | ||||
uint64_t CNetAddr::GetHash() const { | uint64_t CNetAddr::GetHash() const { | ||||
uint256 hash = Hash(&ip[0], &ip[16]); | uint256 hash = Hash(ip); | ||||
uint64_t nRet; | uint64_t nRet; | ||||
memcpy(&nRet, &hash, sizeof(nRet)); | memcpy(&nRet, &hash, sizeof(nRet)); | ||||
return nRet; | return nRet; | ||||
} | } | ||||
// private extensions to enum Network, only returned by GetExtNetwork, and only | // private extensions to enum Network, only returned by GetExtNetwork, and only | ||||
// used in GetReachabilityFrom | // used in GetReachabilityFrom | ||||
static const int NET_UNKNOWN = NET_MAX + 0; | static const int NET_UNKNOWN = NET_MAX + 0; | ||||
▲ Show 20 Lines • Show All 384 Lines • Show Last 20 Lines |