8
8
#include " serialize.h"
9
9
#include " streams.h"
10
10
11
- using namespace std ;
12
-
13
11
int CAddrInfo::GetTriedBucket (const uint256& nKey) const
14
12
{
15
13
uint64_t hash1 = (CHashWriter (SER_GETHASH, 0 ) << nKey << GetKey ()).GetHash ().GetCheapHash ();
@@ -68,7 +66,7 @@ double CAddrInfo::GetChance(int64_t nNow) const
68
66
fChance *= 0.01 ;
69
67
70
68
// deprioritize 66% after each failed attempt, but at most 1/28th to avoid the search taking forever or overly penalizing outages.
71
- fChance *= pow (0.66 , min (nAttempts, 8 ));
69
+ fChance *= pow (0.66 , std:: min (nAttempts, 8 ));
72
70
73
71
return fChance ;
74
72
}
@@ -258,7 +256,7 @@ bool CAddrMan::Add_(const CAddress& addr, const CNetAddr& source, int64_t nTimeP
258
256
bool fCurrentlyOnline = (GetAdjustedTime () - addr.nTime < 24 * 60 * 60 );
259
257
int64_t nUpdateInterval = (fCurrentlyOnline ? 60 * 60 : 24 * 60 * 60 );
260
258
if (addr.nTime && (!pinfo->nTime || pinfo->nTime < addr.nTime - nUpdateInterval - nTimePenalty))
261
- pinfo->nTime = max ((int64_t )0 , addr.nTime - nTimePenalty);
259
+ pinfo->nTime = std:: max ((int64_t )0 , addr.nTime - nTimePenalty);
262
260
263
261
// add services
264
262
pinfo->nServices |= addr.nServices ;
@@ -283,7 +281,7 @@ bool CAddrMan::Add_(const CAddress& addr, const CNetAddr& source, int64_t nTimeP
283
281
return false ;
284
282
} else {
285
283
pinfo = Create (addr, source, &nId);
286
- pinfo->nTime = max ((int64_t )0 , (int64_t )pinfo->nTime - nTimePenalty);
284
+ pinfo->nTime = std:: max ((int64_t )0 , (int64_t )pinfo->nTime - nTimePenalty);
287
285
nNew++;
288
286
fNew = true ;
289
287
}
0 commit comments