Skip to content

Commit 23b2a68

Browse files
author
MarcoFalke
committed
Merge #18275: wallet: error if an explicit fee rate was given but the needed fee rate differed
44cc75f 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 44cc75f (rebased) fjahr: re-ACK 44cc75f Tree-SHA512: cd5a60ee496e64f7ab37aaa53f7748a7393357b1629ccd9660839d366c6191b6413b871ce3aa7293fce1539336222c300ef6f86304f30a1ae8fe361b02310483
2 parents 86590c1 + 44cc75f commit 23b2a68

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/wallet/wallet.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2742,6 +2742,12 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CTransac
27422742

27432743
// Get the fee rate to use effective values in coin selection
27442744
CFeeRate nFeeRateNeeded = GetMinimumFeeRate(*this, coin_control, &feeCalc);
2745+
// Do not, ever, assume that it's fine to change the fee rate if the user has explicitly
2746+
// provided one
2747+
if (coin_control.m_feerate && nFeeRateNeeded > *coin_control.m_feerate) {
2748+
error = strprintf(_("Fee rate (%s) is lower than the minimum fee rate setting (%s)"), coin_control.m_feerate->ToString(), nFeeRateNeeded.ToString());
2749+
return false;
2750+
}
27452751

27462752
nFeeRet = 0;
27472753
bool pick_new_inputs = true;

0 commit comments

Comments
 (0)