Browse Source

Merge #9553: Use z = std::max(x - y, 0) instead of z = x - y; if (z < 0) z = 0;

a47da4b Use z = std::max(x - y, 0); instead of z = x - y; if (z < 0) z = 0; (practicalswift)
0.14
Wladimir J. van der Laan 8 years ago
parent
commit
4c69d683f2
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 6
      src/addrman.cpp
  2. 4
      src/qt/coincontroldialog.cpp

6
src/addrman.cpp

@ -53,11 +53,7 @@ bool CAddrInfo::IsTerrible(int64_t nNow) const @@ -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)

4
src/qt/coincontroldialog.cpp

@ -563,9 +563,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) @@ -563,9 +563,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
}
// after fee
nAfterFee = nAmount - nPayFee;
if (nAfterFee < 0)
nAfterFee = 0;
nAfterFee = std::max<CAmount>(nAmount - nPayFee, 0);
}
// actually update labels

Loading…
Cancel
Save