Page MenuHomePhabricator

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

Authored by PiRK on Aug 25 2021, 12:25.

Details

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);
         }

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable