@@ -41,7 +41,7 @@ static constexpr size_t ADDRMAN_SET_TRIED_COLLISION_SIZE{10};
4141/* * The maximum time we'll spend trying to resolve a tried table collision, in seconds */
4242static constexpr int64_t ADDRMAN_TEST_WINDOW{40 *60 }; // 40 minutes
4343
44- int AddrInfo::GetTriedBucket (const uint256& nKey, const std::vector<bool > & asmap) const
44+ int AddrInfo::GetTriedBucket (const uint256& nKey, const std::vector<bool >& asmap) const
4545{
4646 uint64_t hash1 = (CHashWriter (SER_GETHASH, 0 ) << nKey << GetKey ()).GetCheapHash ();
4747 uint64_t hash2 = (CHashWriter (SER_GETHASH, 0 ) << nKey << GetGroup (asmap) << (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP)).GetCheapHash ();
@@ -51,7 +51,7 @@ int AddrInfo::GetTriedBucket(const uint256& nKey, const std::vector<bool> &asmap
5151 return tried_bucket;
5252}
5353
54- int AddrInfo::GetNewBucket (const uint256& nKey, const CNetAddr& src, const std::vector<bool > & asmap) const
54+ int AddrInfo::GetNewBucket (const uint256& nKey, const CNetAddr& src, const std::vector<bool >& asmap) const
5555{
5656 std::vector<unsigned char > vchSourceGroupKey = src.GetGroup (asmap);
5757 uint64_t hash1 = (CHashWriter (SER_GETHASH, 0 ) << nKey << GetGroup (asmap) << vchSourceGroupKey).GetCheapHash ();
@@ -62,7 +62,7 @@ int AddrInfo::GetNewBucket(const uint256& nKey, const CNetAddr& src, const std::
6262 return new_bucket;
6363}
6464
65- int AddrInfo::GetBucketPosition (const uint256 & nKey, bool fNew , int nBucket) const
65+ int AddrInfo::GetBucketPosition (const uint256& nKey, bool fNew , int nBucket) const
6666{
6767 uint64_t hash1 = (CHashWriter (SER_GETHASH, 0 ) << nKey << (fNew ? uint8_t {' N' } : uint8_t {' K' }) << nBucket << GetKey ()).GetCheapHash ();
6868 return hash1 % ADDRMAN_BUCKET_SIZE;
@@ -190,7 +190,7 @@ void AddrManImpl::Serialize(Stream& s_) const
190190 int nIds = 0 ;
191191 for (const auto & entry : mapInfo) {
192192 mapUnkIds[entry.first ] = nIds;
193- const AddrInfo & info = entry.second ;
193+ const AddrInfo& info = entry.second ;
194194 if (info.nRefCount ) {
195195 assert (nIds != nNew); // this means nNew was wrong, oh ow
196196 s << info;
@@ -199,7 +199,7 @@ void AddrManImpl::Serialize(Stream& s_) const
199199 }
200200 nIds = 0 ;
201201 for (const auto & entry : mapInfo) {
202- const AddrInfo & info = entry.second ;
202+ const AddrInfo& info = entry.second ;
203203 if (info.fInTried ) {
204204 assert (nIds != nTried); // this means nTried was wrong, oh ow
205205 s << info;
@@ -283,7 +283,7 @@ void AddrManImpl::Unserialize(Stream& s_)
283283
284284 // Deserialize entries from the new table.
285285 for (int n = 0 ; n < nNew; n++) {
286- AddrInfo & info = mapInfo[n];
286+ AddrInfo& info = mapInfo[n];
287287 s >> info;
288288 mapAddr[info] = n;
289289 info.nRandomPos = vRandom.size ();
@@ -1024,7 +1024,7 @@ size_t AddrManImpl::size() const
10241024 return vRandom.size ();
10251025}
10261026
1027- bool AddrManImpl::Add (const std::vector<CAddress> & vAddr, const CNetAddr& source, int64_t nTimePenalty)
1027+ bool AddrManImpl::Add (const std::vector<CAddress>& vAddr, const CNetAddr& source, int64_t nTimePenalty)
10281028{
10291029 LOCK (cs);
10301030 int nAdd = 0 ;
@@ -1038,15 +1038,15 @@ bool AddrManImpl::Add(const std::vector<CAddress> &vAddr, const CNetAddr& source
10381038 return nAdd > 0 ;
10391039}
10401040
1041- void AddrManImpl::Good (const CService & addr, int64_t nTime)
1041+ void AddrManImpl::Good (const CService& addr, int64_t nTime)
10421042{
10431043 LOCK (cs);
10441044 Check ();
10451045 Good_ (addr, /* test_before_evict */ true , nTime);
10461046 Check ();
10471047}
10481048
1049- void AddrManImpl::Attempt (const CService & addr, bool fCountFailure , int64_t nTime)
1049+ void AddrManImpl::Attempt (const CService& addr, bool fCountFailure , int64_t nTime)
10501050{
10511051 LOCK (cs);
10521052 Check ();
@@ -1089,15 +1089,15 @@ std::vector<CAddress> AddrManImpl::GetAddr(size_t max_addresses, size_t max_pct,
10891089 return addresses;
10901090}
10911091
1092- void AddrManImpl::Connected (const CService & addr, int64_t nTime)
1092+ void AddrManImpl::Connected (const CService& addr, int64_t nTime)
10931093{
10941094 LOCK (cs);
10951095 Check ();
10961096 Connected_ (addr, nTime);
10971097 Check ();
10981098}
10991099
1100- void AddrManImpl::SetServices (const CService & addr, ServiceFlags nServices)
1100+ void AddrManImpl::SetServices (const CService& addr, ServiceFlags nServices)
11011101{
11021102 LOCK (cs);
11031103 Check ();
@@ -1141,17 +1141,17 @@ size_t AddrMan::size() const
11411141 return m_impl->size ();
11421142}
11431143
1144- bool AddrMan::Add (const std::vector<CAddress> & vAddr, const CNetAddr& source, int64_t nTimePenalty)
1144+ bool AddrMan::Add (const std::vector<CAddress>& vAddr, const CNetAddr& source, int64_t nTimePenalty)
11451145{
11461146 return m_impl->Add (vAddr, source, nTimePenalty);
11471147}
11481148
1149- void AddrMan::Good (const CService & addr, int64_t nTime)
1149+ void AddrMan::Good (const CService& addr, int64_t nTime)
11501150{
11511151 m_impl->Good (addr, nTime);
11521152}
11531153
1154- void AddrMan::Attempt (const CService & addr, bool fCountFailure , int64_t nTime)
1154+ void AddrMan::Attempt (const CService& addr, bool fCountFailure , int64_t nTime)
11551155{
11561156 m_impl->Attempt (addr, fCountFailure , nTime);
11571157}
@@ -1176,12 +1176,12 @@ std::vector<CAddress> AddrMan::GetAddr(size_t max_addresses, size_t max_pct, std
11761176 return m_impl->GetAddr (max_addresses, max_pct, network);
11771177}
11781178
1179- void AddrMan::Connected (const CService & addr, int64_t nTime)
1179+ void AddrMan::Connected (const CService& addr, int64_t nTime)
11801180{
11811181 m_impl->Connected (addr, nTime);
11821182}
11831183
1184- void AddrMan::SetServices (const CService & addr, ServiceFlags nServices)
1184+ void AddrMan::SetServices (const CService& addr, ServiceFlags nServices)
11851185{
11861186 m_impl->SetServices (addr, nServices);
11871187}
0 commit comments