mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
wallet: error if an explicit fee rate was given but the needed fee rate differed
This avoids cases where a user requests a fee rate below the minimum and is silently overruled by the wallet.
This commit is contained in:
parent
ec79b5f86b
commit
44cc75f80e
1 changed files with 6 additions and 0 deletions
|
|
@ -2729,6 +2729,12 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CTransac
|
||||||
|
|
||||||
// Get the fee rate to use effective values in coin selection
|
// Get the fee rate to use effective values in coin selection
|
||||||
CFeeRate nFeeRateNeeded = GetMinimumFeeRate(*this, coin_control, &feeCalc);
|
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;
|
nFeeRet = 0;
|
||||||
bool pick_new_inputs = true;
|
bool pick_new_inputs = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue