aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/addrman.cpp6
-rw-r--r--src/qt/coincontroldialog.cpp4
2 files changed, 2 insertions, 8 deletions
diff --git a/src/addrman.cpp b/src/addrman.cpp
index f3c238fbb2..b6ab4c6305 100644
--- a/src/addrman.cpp
+++ b/src/addrman.cpp
@@ -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)
diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp
index f8aba70d92..d4fd8bd372 100644
--- a/src/qt/coincontroldialog.cpp
+++ b/src/qt/coincontroldialog.cpp
@@ -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