| 9 | #include "streams.h" |
| 10 | |
| 11 | int 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 | |
| 18 | int CAddrInfo::GetNewBucket(const uint256& nKey, const CNetAddr& src) const |
| 19 | { |