@@ -24,78 +24,6 @@ class AddrManImpl;
24
24
/* * Default for -checkaddrman */
25
25
static constexpr int32_t DEFAULT_ADDRMAN_CONSISTENCY_CHECKS{0 };
26
26
27
- /* *
28
- * Extended statistics about a CAddress
29
- */
30
- class CAddrInfo : public CAddress
31
- {
32
- public:
33
- // ! last try whatsoever by us (memory only)
34
- int64_t nLastTry{0 };
35
-
36
- // ! last counted attempt (memory only)
37
- int64_t nLastCountAttempt{0 };
38
-
39
- private:
40
- // ! where knowledge about this address first came from
41
- CNetAddr source;
42
-
43
- // ! last successful connection by us
44
- int64_t nLastSuccess{0 };
45
-
46
- // ! connection attempts since last successful attempt
47
- int nAttempts{0 };
48
-
49
- // ! reference count in new sets (memory only)
50
- int nRefCount{0 };
51
-
52
- // ! in tried set? (memory only)
53
- bool fInTried {false };
54
-
55
- // ! position in vRandom
56
- mutable int nRandomPos{-1 };
57
-
58
- friend class AddrManImpl ;
59
- friend class CAddrManDeterministic ;
60
-
61
- public:
62
-
63
- SERIALIZE_METHODS (CAddrInfo, obj)
64
- {
65
- READWRITEAS (CAddress, obj);
66
- READWRITE (obj.source , obj.nLastSuccess , obj.nAttempts );
67
- }
68
-
69
- CAddrInfo (const CAddress &addrIn, const CNetAddr &addrSource) : CAddress(addrIn), source(addrSource)
70
- {
71
- }
72
-
73
- CAddrInfo () : CAddress(), source()
74
- {
75
- }
76
-
77
- // ! Calculate in which "tried" bucket this entry belongs
78
- int GetTriedBucket (const uint256 &nKey, const std::vector<bool > &asmap) const ;
79
-
80
- // ! Calculate in which "new" bucket this entry belongs, given a certain source
81
- int GetNewBucket (const uint256 &nKey, const CNetAddr& src, const std::vector<bool > &asmap) const ;
82
-
83
- // ! Calculate in which "new" bucket this entry belongs, using its default source
84
- int GetNewBucket (const uint256 &nKey, const std::vector<bool > &asmap) const
85
- {
86
- return GetNewBucket (nKey, source, asmap);
87
- }
88
-
89
- // ! Calculate in which position of a bucket to store this entry.
90
- int GetBucketPosition (const uint256 &nKey, bool fNew , int nBucket) const ;
91
-
92
- // ! Determine whether the statistics about this entry are bad enough so that it can just be deleted
93
- bool IsTerrible (int64_t nNow = GetAdjustedTime()) const ;
94
-
95
- // ! Calculate the relative chance this entry should be given when selecting nodes to connect to
96
- double GetChance (int64_t nNow = GetAdjustedTime()) const ;
97
- };
98
-
99
27
/* * Stochastic address manager
100
28
*
101
29
* Design goals:
0 commit comments