diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui --- a/src/qt/forms/sendcoinsdialog.ui +++ b/src/qt/forms/sendcoinsdialog.ui @@ -856,28 +856,15 @@ - - - Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process. - - - - - - - - + true - Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process. + When there is less transaction volume than space in the blocks, miners as well as relaying nodes may enforce a minimum fee. Paying only this minimum fee is just fine, but be aware that this can result in a never confirming transaction once there is more demand for bitcoin transactions than the network can process. - (read the tooltip) - - - 5 + A too low fee might result in a never confirming transaction (read the tooltip) @@ -970,9 +957,6 @@ - - 2 - @@ -987,9 +971,6 @@ (Smart fee not initialized yet. This usually takes a few blocks...) - - 2 - diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h --- a/src/qt/sendcoinsdialog.h +++ b/src/qt/sendcoinsdialog.h @@ -101,9 +101,7 @@ void coinControlClipboardBytes(); void coinControlClipboardLowOutput(); void coinControlClipboardChange(); - void setMinimumFee(); void updateFeeSectionControls(); - void updateMinFeeLabel(); void updateSmartFeeLabel(); Q_SIGNALS: diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -116,19 +116,15 @@ settings.setValue("nTransactionFee", qint64(DEFAULT_PAY_TX_FEE / SATOSHI)); } - if (!settings.contains("fPayOnlyMinFee")) { - settings.setValue("fPayOnlyMinFee", false); - } ui->groupFee->setId(ui->radioSmartFee, 0); ui->groupFee->setId(ui->radioCustomFee, 1); ui->groupFee ->button( std::max(0, std::min(1, settings.value("nFeeRadio").toInt()))) ->setChecked(true); + ui->customFee->SetAllowEmpty(false); ui->customFee->setValue( int64_t(settings.value("nTransactionFee").toLongLong()) * SATOSHI); - ui->checkBoxMinimumFee->setChecked( - settings.value("fPayOnlyMinFee").toBool()); minimizeFeeSection(settings.value("fFeeSectionMinimized").toBool()); // Set the model properly. @@ -190,16 +186,13 @@ &SendCoinsDialog::coinControlUpdateLabels); connect(ui->customFee, &BitcoinAmountField::valueChanged, this, &SendCoinsDialog::coinControlUpdateLabels); - connect(ui->checkBoxMinimumFee, &QCheckBox::stateChanged, this, - &SendCoinsDialog::setMinimumFee); - connect(ui->checkBoxMinimumFee, &QCheckBox::stateChanged, this, - &SendCoinsDialog::updateFeeSectionControls); - connect(ui->checkBoxMinimumFee, &QCheckBox::stateChanged, this, - &SendCoinsDialog::coinControlUpdateLabels); - - ui->customFee->setSingleStep(model->wallet().getRequiredFee(1000)); + Amount requiredFee = model->wallet().getRequiredFee(1000); + ui->customFee->SetMinValue(requiredFee); + if (ui->customFee->value() < requiredFee) { + ui->customFee->setValue(requiredFee); + } + ui->customFee->setSingleStep(requiredFee); updateFeeSectionControls(); - updateMinFeeLabel(); updateSmartFeeLabel(); if (model->wallet().privateKeysDisabled()) { @@ -219,7 +212,6 @@ settings.setValue("nFeeRadio", ui->groupFee->checkedId()); settings.setValue("nTransactionFee", qint64(ui->customFee->value() / SATOSHI)); - settings.setValue("fPayOnlyMinFee", ui->checkBoxMinimumFee->isChecked()); delete ui; } @@ -656,7 +648,6 @@ void SendCoinsDialog::updateDisplayUnit() { setBalance(model->wallet().getBalances()); ui->customFee->setDisplayUnit(model->getOptionsModel()->getDisplayUnit()); - updateMinFeeLabel(); updateSmartFeeLabel(); } @@ -761,21 +752,13 @@ } } -void SendCoinsDialog::setMinimumFee() { - ui->customFee->setValue(model->wallet().getRequiredFee(1000)); -} - void SendCoinsDialog::updateFeeSectionControls() { ui->labelSmartFee->setEnabled(ui->radioSmartFee->isChecked()); ui->labelSmartFee2->setEnabled(ui->radioSmartFee->isChecked()); ui->labelFeeEstimation->setEnabled(ui->radioSmartFee->isChecked()); - ui->checkBoxMinimumFee->setEnabled(ui->radioCustomFee->isChecked()); - ui->labelMinFeeWarning->setEnabled(ui->radioCustomFee->isChecked()); - ui->labelCustomPerKilobyte->setEnabled( - ui->radioCustomFee->isChecked() && - !ui->checkBoxMinimumFee->isChecked()); - ui->customFee->setEnabled(ui->radioCustomFee->isChecked() && - !ui->checkBoxMinimumFee->isChecked()); + ui->labelCustomFeeWarning->setEnabled(ui->radioCustomFee->isChecked()); + ui->labelCustomPerKilobyte->setEnabled(ui->radioCustomFee->isChecked()); + ui->customFee->setEnabled(ui->radioCustomFee->isChecked()); } void SendCoinsDialog::updateFeeMinimizedLabel() { @@ -794,17 +777,6 @@ } } -void SendCoinsDialog::updateMinFeeLabel() { - if (model && model->getOptionsModel()) { - ui->checkBoxMinimumFee->setText( - tr("Pay only the required fee of %1") - .arg(BitcoinUnits::formatWithUnit( - model->getOptionsModel()->getDisplayUnit(), - model->wallet().getRequiredFee(1000)) + - "/kB")); - } -} - void SendCoinsDialog::updateCoinControlState(CCoinControl &ctrl) { if (ui->radioCustomFee->isChecked()) { ctrl.m_feerate = CFeeRate(ui->customFee->value());