Skip to content

Commit fa9284c

Browse files
author
MacroFake
committed
refactor: Remove not needed std::max
1 parent 5057adf commit fa9284c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/addrman.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ bool AddrInfo::IsTerrible(int64_t nNow) const
8989
double AddrInfo::GetChance(int64_t nNow) const
9090
{
9191
double fChance = 1.0;
92-
int64_t nSinceLastTry = std::max<int64_t>(nNow - nLastTry, 0);
9392

9493
// deprioritize very recent attempts away
95-
if (nSinceLastTry < 60 * 10)
94+
if (nNow - nLastTry < 60 * 10) {
9695
fChance *= 0.01;
96+
}
9797

9898
// deprioritize 66% after each failed attempt, but at most 1/28th to avoid the search taking forever or overly penalizing outages.
9999
fChance *= pow(0.66, std::min(nAttempts, 8));

0 commit comments

Comments
 (0)