MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / GetTriedBucket

Method GetTriedBucket

src/addrman.cpp:11–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include "streams.h"
10
11int CAddrInfo::GetTriedBucket(const uint256& nKey) const
12{
13 uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << GetKey()).GetHash().GetCheapHash();
14 uint64_t hash2 = (CHashWriter(SER_GETHASH, 0) << nKey << GetGroup() << (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP)).GetHash().GetCheapHash();
15 return hash2 % ADDRMAN_TRIED_BUCKET_COUNT;
16}
17
18int CAddrInfo::GetNewBucket(const uint256& nKey, const CNetAddr& src) const
19{

Callers 4

MakeTriedMethod · 0.80
Check_Method · 0.80
UnserializeMethod · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80

Calls 3

CHashWriterClass · 0.85
GetCheapHashMethod · 0.80
GetHashMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64