|
15 | 15 | #include <unordered_map>
|
16 | 16 | #include <unordered_set>
|
17 | 17 |
|
18 |
| -//! over how many buckets entries with tried addresses from a single group (/16 for IPv4) are spread |
| 18 | +/** Over how many buckets entries with tried addresses from a single group (/16 for IPv4) are spread */ |
19 | 19 | static constexpr uint32_t ADDRMAN_TRIED_BUCKETS_PER_GROUP{8};
|
20 |
| - |
21 |
| -//! over how many buckets entries with new addresses originating from a single group are spread |
| 20 | +/** Over how many buckets entries with new addresses originating from a single group are spread */ |
22 | 21 | static constexpr uint32_t ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP{64};
|
23 |
| - |
24 |
| -//! in how many buckets for entries with new addresses a single address may occur |
| 22 | +/** Maximum number of times an address can be added to the new table */ |
25 | 23 | static constexpr int32_t ADDRMAN_NEW_BUCKETS_PER_ADDRESS{8};
|
26 |
| - |
27 |
| -//! how old addresses can maximally be |
| 24 | +/** How old addresses can maximally be */ |
28 | 25 | static constexpr int64_t ADDRMAN_HORIZON_DAYS{30};
|
29 |
| - |
30 |
| -//! after how many failed attempts we give up on a new node |
| 26 | +/** After how many failed attempts we give up on a new node */ |
31 | 27 | static constexpr int32_t ADDRMAN_RETRIES{3};
|
32 |
| - |
33 |
| -//! how many successive failures are allowed ... |
| 28 | +/** How many successive failures are allowed ... */ |
34 | 29 | static constexpr int32_t ADDRMAN_MAX_FAILURES{10};
|
35 |
| - |
36 |
| -//! ... in at least this many days |
| 30 | +/** ... in at least this many days */ |
37 | 31 | static constexpr int64_t ADDRMAN_MIN_FAIL_DAYS{7};
|
38 |
| - |
39 |
| -//! how recent a successful connection should be before we allow an address to be evicted from tried |
| 32 | +/** How recent a successful connection should be before we allow an address to be evicted from tried */ |
40 | 33 | static constexpr int64_t ADDRMAN_REPLACEMENT_HOURS{4};
|
41 |
| - |
42 |
| -//! the maximum number of tried addr collisions to store |
| 34 | +/** The maximum number of tried addr collisions to store */ |
43 | 35 | static constexpr size_t ADDRMAN_SET_TRIED_COLLISION_SIZE{10};
|
44 |
| - |
45 |
| -//! the maximum time we'll spend trying to resolve a tried table collision, in seconds |
| 36 | +/** The maximum time we'll spend trying to resolve a tried table collision, in seconds */ |
46 | 37 | static constexpr int64_t ADDRMAN_TEST_WINDOW{40*60}; // 40 minutes
|
47 | 38 |
|
48 |
| - |
49 | 39 | int CAddrInfo::GetTriedBucket(const uint256& nKey, const std::vector<bool> &asmap) const
|
50 | 40 | {
|
51 | 41 | uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << GetKey()).GetCheapHash();
|
|
0 commit comments