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