Merge #18275: wallet: error if an explicit fee rate was given but the needed fee rate differed

44cc75f80e wallet: error if an explicit fee rate was given but the needed fee rate differed (Karl-Johan Alm)

Pull request description:

  This ensures that the code doesn't silently ignore too low fee reates. It will now trigger an error in the QT client, if the user provides a fee rate below the minimum, and becomes a necessary check for #11413.

ACKs for top commit:
  Sjors:
    utACK 44cc75f80e (rebased)
  fjahr:
    re-ACK 44cc75f80e

Tree-SHA512: cd5a60ee496e64f7ab37aaa53f7748a7393357b1629ccd9660839d366c6191b6413b871ce3aa7293fce1539336222c300ef6f86304f30a1ae8fe361b02310483
This commit is contained in:
MarcoFalke 2020-06-16 13:46:06 -04:00
commit 23b2a68df5
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -2742,6 +2742,12 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CTransac
// Get the fee rate to use effective values in coin selection
CFeeRate nFeeRateNeeded = GetMinimumFeeRate(*this, coin_control, &feeCalc);
// Do not, ever, assume that it's fine to change the fee rate if the user has explicitly
// provided one
if (coin_control.m_feerate && nFeeRateNeeded > *coin_control.m_feerate) {
error = strprintf(_("Fee rate (%s) is lower than the minimum fee rate setting (%s)"), coin_control.m_feerate->ToString(), nFeeRateNeeded.ToString());
return false;
}
nFeeRet = 0;
bool pick_new_inputs = true;