HomePhabricator

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

Description

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

Summary:
This avoids cases where a user requests a fee rate below the minimum and is silently overruled by the wallet.

This is a backport of core#18275

Test Plan:
Run bitcoin-qt and manually set a too low fee when trying to send a transaction.

The following patch may be needed to let the interface set a fee lower than the minimum:

diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp
index dc9c4bf699..99da1f837d 100644
--- a/src/qt/sendcoinsdialog.cpp
+++ b/src/qt/sendcoinsdialog.cpp
@@ -188,7 +188,7 @@ void SendCoinsDialog::setModel(WalletModel *_model) {
         connect(ui->customFee, &BitcoinAmountField::valueChanged, this,
                 &SendCoinsDialog::coinControlUpdateLabels);
         Amount requiredFee = model->wallet().getRequiredFee(1000);
-        ui->customFee->SetMinValue(requiredFee);
+        ui->customFee->SetMinValue(Amount::satoshi());
         if (ui->customFee->value() < requiredFee) {
             ui->customFee->setValue(requiredFee);
         }

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D9936

Details

Provenance
Karl-Johan Alm <karljohan-alm@garage.co.jp>Authored on Mar 3 2020, 05:09
PiRKCommitted on Aug 26 2021, 08:04
PiRKPushed on Aug 26 2021, 08:04
Reviewer
Restricted Project
Differential Revision
D9936: wallet: error if an explicit fee rate was given but the needed fee rate differed
Parents
rABCa049e43d9b4a: [Automated] Update timing.json
Branches
Unknown
Tags
Unknown