mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Use z = std::max(x - y, 0); instead of z = x - y; if (z < 0) z = 0;
This commit is contained in:
@@ -53,11 +53,7 @@ bool CAddrInfo::IsTerrible(int64_t nNow) const
|
||||
double CAddrInfo::GetChance(int64_t nNow) const
|
||||
{
|
||||
double fChance = 1.0;
|
||||
|
||||
int64_t nSinceLastTry = nNow - nLastTry;
|
||||
|
||||
if (nSinceLastTry < 0)
|
||||
nSinceLastTry = 0;
|
||||
int64_t nSinceLastTry = std::max<int64_t>(nNow - nLastTry, 0);
|
||||
|
||||
// deprioritize very recent attempts away
|
||||
if (nSinceLastTry < 60 * 10)
|
||||
|
||||
Reference in New Issue
Block a user