diff options
author | MacroFake <falke.marco@gmail.com> | 2022-07-26 11:10:03 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-07-26 11:03:31 +0200 |
commit | fa9284c3e9acec4b44b2560256f27b3d78c753e2 (patch) | |
tree | 76c09338f2342b826582db963902e61cd0799078 /src/addrman.cpp | |
parent | 5057adf22fc4c3593e1e633defeda96be508f198 (diff) | |
download | bitcoin-fa9284c3e9acec4b44b2560256f27b3d78c753e2.tar.xz |
refactor: Remove not needed std::max
Diffstat (limited to 'src/addrman.cpp')
-rw-r--r-- | src/addrman.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/addrman.cpp b/src/addrman.cpp index 204bb544c5..7b5b05ad53 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -89,11 +89,11 @@ bool AddrInfo::IsTerrible(int64_t nNow) const double AddrInfo::GetChance(int64_t nNow) const { double fChance = 1.0; - int64_t nSinceLastTry = std::max<int64_t>(nNow - nLastTry, 0); // deprioritize very recent attempts away - if (nSinceLastTry < 60 * 10) + if (nNow - nLastTry < 60 * 10) { fChance *= 0.01; + } // deprioritize 66% after each failed attempt, but at most 1/28th to avoid the search taking forever or overly penalizing outages. fChance *= pow(0.66, std::min(nAttempts, 8)); |