MCPcopy Create free account
hub / github.com/LUX-Core/lux / GetTriedBucket

Method GetTriedBucket

src/addrman.cpp:15–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13using namespace std;
14
15int CAddrInfo::GetTriedBucket(const uint256& nKey) const
16{
17 uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << GetKey()).GetHash().GetLow64();
18 uint64_t hash2 = (CHashWriter(SER_GETHASH, 0) << nKey << GetGroup() << (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP)).GetHash().GetLow64();
19 return hash2 % ADDRMAN_TRIED_BUCKET_COUNT;
20}
21
22int CAddrInfo::GetNewBucket(const uint256& nKey, const CNetAddr& src) const
23{

Callers 3

MakeTriedMethod · 0.80
Check_Method · 0.80
UnserializeMethod · 0.80

Calls 3

CHashWriterClass · 0.85
GetLow64Method · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected