Skip to content

Commit 26a639e

Browse files
author
Philip Kaufmann
committed
remove using namespace std from addrman.cpp
1 parent 40c592a commit 26a639e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/addrman.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
#include "serialize.h"
99
#include "streams.h"
1010

11-
using namespace std;
12-
1311
int CAddrInfo::GetTriedBucket(const uint256& nKey) const
1412
{
1513
uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << GetKey()).GetHash().GetCheapHash();
@@ -68,7 +66,7 @@ double CAddrInfo::GetChance(int64_t nNow) const
6866
fChance *= 0.01;
6967

7068
// 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));
7270

7371
return fChance;
7472
}
@@ -258,7 +256,7 @@ bool CAddrMan::Add_(const CAddress& addr, const CNetAddr& source, int64_t nTimeP
258256
bool fCurrentlyOnline = (GetAdjustedTime() - addr.nTime < 24 * 60 * 60);
259257
int64_t nUpdateInterval = (fCurrentlyOnline ? 60 * 60 : 24 * 60 * 60);
260258
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);
262260

263261
// add services
264262
pinfo->nServices |= addr.nServices;
@@ -283,7 +281,7 @@ bool CAddrMan::Add_(const CAddress& addr, const CNetAddr& source, int64_t nTimeP
283281
return false;
284282
} else {
285283
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);
287285
nNew++;
288286
fNew = true;
289287
}

0 commit comments

Comments
 (0)