Changeset View
Changeset View
Standalone View
Standalone View
src/seeder/netbase.cpp
Show First 20 Lines • Show All 811 Lines • ▼ Show 20 Lines | while (nBits >= 8) { | ||||
nBits -= 8; | nBits -= 8; | ||||
} | } | ||||
if (nBits > 0) | if (nBits > 0) | ||||
vchRet.push_back(GetByte(15 - nStartByte) | ((1 << nBits) - 1)); | vchRet.push_back(GetByte(15 - nStartByte) | ((1 << nBits) - 1)); | ||||
return vchRet; | return vchRet; | ||||
} | } | ||||
uint64 CNetAddr::GetHash() const { | uint64_t CNetAddr::GetHash() const { | ||||
uint256 hash = Hash(&ip[0], &ip[16]); | uint256 hash = Hash(&ip[0], &ip[16]); | ||||
uint64 nRet; | uint64_t nRet; | ||||
memcpy(&nRet, &hash, sizeof(nRet)); | memcpy(&nRet, &hash, sizeof(nRet)); | ||||
return nRet; | return nRet; | ||||
} | } | ||||
void CNetAddr::print() const { | void CNetAddr::print() const { | ||||
printf("CNetAddr(%s)\n", ToString().c_str()); | printf("CNetAddr(%s)\n", ToString().c_str()); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 236 Lines • Show Last 20 Lines |