| 44 | static constexpr int64_t ADDRMAN_TEST_WINDOW{40*60}; // 40 minutes |
| 45 | |
| 46 | int AddrInfo::GetTriedBucket(const uint256& nKey, const std::vector<bool>& asmap) const |
| 47 | { |
| 48 | uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << GetKey()).GetCheapHash(); |
| 49 | uint64_t hash2 = (CHashWriter(SER_GETHASH, 0) << nKey << GetGroup(asmap) << (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP)).GetCheapHash(); |
| 50 | return hash2 % ADDRMAN_TRIED_BUCKET_COUNT; |
| 51 | } |
| 52 | |
| 53 | int AddrInfo::GetNewBucket(const uint256& nKey, const CNetAddr& src, const std::vector<bool>& asmap) const |
| 54 | { |