diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-06-16 13:46:06 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-06-16 13:46:10 -0400 |
commit | 23b2a68df57125734f9b452870e2b18345cda32f (patch) | |
tree | 3a89c7070f9f5b59f30cab39309d97c1ee155278 /src/wallet | |
parent | 86590c17fc17121d214fe7c4f00ab10bc5108f2b (diff) | |
parent | 44cc75f80ee7805a117e9298a182af1a44bcbff4 (diff) |
Merge #18275: wallet: error if an explicit fee rate was given but the needed fee rate differed
44cc75f80ee7805a117e9298a182af1a44bcbff4 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 44cc75f80ee7805a117e9298a182af1a44bcbff4 (rebased)
fjahr:
re-ACK 44cc75f80ee7805a117e9298a182af1a44bcbff4
Tree-SHA512: cd5a60ee496e64f7ab37aaa53f7748a7393357b1629ccd9660839d366c6191b6413b871ce3aa7293fce1539336222c300ef6f86304f30a1ae8fe361b02310483
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/wallet.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 5f318f92ad..567c91a45d 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -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; |