MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetBucketPosition

Method GetBucketPosition

src/addrman.cpp:61–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61int AddrInfo::GetBucketPosition(const uint256& nKey, bool fNew, int nBucket) const
62{
63 uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << (fNew ? uint8_t{'N'} : uint8_t{'K'}) << nBucket << GetKey()).GetCheapHash();
64 return hash1 % ADDRMAN_BUCKET_SIZE;
65}
66
67bool AddrInfo::IsTerrible(int64_t nNow) const
68{

Callers 8

UnserializeMethod · 0.80
MakeTriedMethod · 0.80
AddSingleMethod · 0.80
Good_Method · 0.80
ResolveCollisions_Method · 0.80
SelectTriedCollision_Method · 0.80
FindAddressEntry_Method · 0.80
CheckAddrmanMethod · 0.80

Calls 2

CHashWriterClass · 0.85
GetCheapHashMethod · 0.80

Tested by

no test coverage detected