qt: Remove "Pay only required fee" checkbox
The custom fee input box now has a minimum value equal to the minimum required fee. Before a value below the minimum fee could be entered which was confusing since the minimum fee would still be paid even though a lower amount was entered.
This commit is contained in:
parent
8711cc0c78
commit
a16f44c040
3 changed files with 13 additions and 67 deletions
|
@ -878,28 +878,15 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satoshis p
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayoutFee8">
|
<layout class="QHBoxLayout" name="horizontalLayoutFee8">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkBoxMinimumFee">
|
<widget class="QLabel" name="labelCustomFeeWarning">
|
||||||
<property name="toolTip">
|
|
||||||
<string>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.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="labelMinFeeWarning">
|
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>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.</string>
|
<string>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.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>(read the tooltip)</string>
|
<string>A too low fee might result in a never confirming transaction (read the tooltip)</string>
|
||||||
</property>
|
|
||||||
<property name="margin">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -992,9 +979,6 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satoshis p
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -1009,9 +993,6 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satoshis p
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>(Smart fee not initialized yet. This usually takes a few blocks...)</string>
|
<string>(Smart fee not initialized yet. This usually takes a few blocks...)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
@ -1038,24 +1019,8 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satoshis p
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Confirmation time target:</string>
|
<string>Confirmation time target:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>1</width>
|
|
||||||
<height>1</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
|
@ -119,13 +119,11 @@ SendCoinsDialog::SendCoinsDialog(const PlatformStyle *_platformStyle, QWidget *p
|
||||||
settings.setValue("nSmartFeeSliderPosition", 0);
|
settings.setValue("nSmartFeeSliderPosition", 0);
|
||||||
if (!settings.contains("nTransactionFee"))
|
if (!settings.contains("nTransactionFee"))
|
||||||
settings.setValue("nTransactionFee", (qint64)DEFAULT_PAY_TX_FEE);
|
settings.setValue("nTransactionFee", (qint64)DEFAULT_PAY_TX_FEE);
|
||||||
if (!settings.contains("fPayOnlyMinFee"))
|
|
||||||
settings.setValue("fPayOnlyMinFee", false);
|
|
||||||
ui->groupFee->setId(ui->radioSmartFee, 0);
|
ui->groupFee->setId(ui->radioSmartFee, 0);
|
||||||
ui->groupFee->setId(ui->radioCustomFee, 1);
|
ui->groupFee->setId(ui->radioCustomFee, 1);
|
||||||
ui->groupFee->button((int)std::max(0, std::min(1, settings.value("nFeeRadio").toInt())))->setChecked(true);
|
ui->groupFee->button((int)std::max(0, std::min(1, settings.value("nFeeRadio").toInt())))->setChecked(true);
|
||||||
|
ui->customFee->SetAllowEmpty(false);
|
||||||
ui->customFee->setValue(settings.value("nTransactionFee").toLongLong());
|
ui->customFee->setValue(settings.value("nTransactionFee").toLongLong());
|
||||||
ui->checkBoxMinimumFee->setChecked(settings.value("fPayOnlyMinFee").toBool());
|
|
||||||
minimizeFeeSection(settings.value("fFeeSectionMinimized").toBool());
|
minimizeFeeSection(settings.value("fFeeSectionMinimized").toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,14 +172,15 @@ void SendCoinsDialog::setModel(WalletModel *_model)
|
||||||
connect(ui->groupFee, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &SendCoinsDialog::updateFeeSectionControls);
|
connect(ui->groupFee, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &SendCoinsDialog::updateFeeSectionControls);
|
||||||
connect(ui->groupFee, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &SendCoinsDialog::coinControlUpdateLabels);
|
connect(ui->groupFee, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &SendCoinsDialog::coinControlUpdateLabels);
|
||||||
connect(ui->customFee, &BitcoinAmountField::valueChanged, this, &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);
|
|
||||||
connect(ui->optInRBF, &QCheckBox::stateChanged, this, &SendCoinsDialog::updateSmartFeeLabel);
|
connect(ui->optInRBF, &QCheckBox::stateChanged, this, &SendCoinsDialog::updateSmartFeeLabel);
|
||||||
connect(ui->optInRBF, &QCheckBox::stateChanged, this, &SendCoinsDialog::coinControlUpdateLabels);
|
connect(ui->optInRBF, &QCheckBox::stateChanged, this, &SendCoinsDialog::coinControlUpdateLabels);
|
||||||
ui->customFee->setSingleStep(model->wallet().getRequiredFee(1000));
|
CAmount requiredFee = model->wallet().getRequiredFee(1000);
|
||||||
|
ui->customFee->SetMinValue(requiredFee);
|
||||||
|
if (ui->customFee->value() < requiredFee) {
|
||||||
|
ui->customFee->setValue(requiredFee);
|
||||||
|
}
|
||||||
|
ui->customFee->setSingleStep(requiredFee);
|
||||||
updateFeeSectionControls();
|
updateFeeSectionControls();
|
||||||
updateMinFeeLabel();
|
|
||||||
updateSmartFeeLabel();
|
updateSmartFeeLabel();
|
||||||
|
|
||||||
// set default rbf checkbox state
|
// set default rbf checkbox state
|
||||||
|
@ -210,7 +209,6 @@ SendCoinsDialog::~SendCoinsDialog()
|
||||||
settings.setValue("nFeeRadio", ui->groupFee->checkedId());
|
settings.setValue("nFeeRadio", ui->groupFee->checkedId());
|
||||||
settings.setValue("nConfTarget", getConfTargetForIndex(ui->confTargetSelector->currentIndex()));
|
settings.setValue("nConfTarget", getConfTargetForIndex(ui->confTargetSelector->currentIndex()));
|
||||||
settings.setValue("nTransactionFee", (qint64)ui->customFee->value());
|
settings.setValue("nTransactionFee", (qint64)ui->customFee->value());
|
||||||
settings.setValue("fPayOnlyMinFee", ui->checkBoxMinimumFee->isChecked());
|
|
||||||
|
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
@ -542,7 +540,6 @@ void SendCoinsDialog::updateDisplayUnit()
|
||||||
{
|
{
|
||||||
setBalance(model->wallet().getBalances());
|
setBalance(model->wallet().getBalances());
|
||||||
ui->customFee->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
|
ui->customFee->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
|
||||||
updateMinFeeLabel();
|
|
||||||
updateSmartFeeLabel();
|
updateSmartFeeLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -642,11 +639,6 @@ void SendCoinsDialog::useAvailableBalance(SendCoinsEntry* entry)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendCoinsDialog::setMinimumFee()
|
|
||||||
{
|
|
||||||
ui->customFee->setValue(model->wallet().getRequiredFee(1000));
|
|
||||||
}
|
|
||||||
|
|
||||||
void SendCoinsDialog::updateFeeSectionControls()
|
void SendCoinsDialog::updateFeeSectionControls()
|
||||||
{
|
{
|
||||||
ui->confTargetSelector ->setEnabled(ui->radioSmartFee->isChecked());
|
ui->confTargetSelector ->setEnabled(ui->radioSmartFee->isChecked());
|
||||||
|
@ -654,10 +646,9 @@ void SendCoinsDialog::updateFeeSectionControls()
|
||||||
ui->labelSmartFee2 ->setEnabled(ui->radioSmartFee->isChecked());
|
ui->labelSmartFee2 ->setEnabled(ui->radioSmartFee->isChecked());
|
||||||
ui->labelSmartFee3 ->setEnabled(ui->radioSmartFee->isChecked());
|
ui->labelSmartFee3 ->setEnabled(ui->radioSmartFee->isChecked());
|
||||||
ui->labelFeeEstimation ->setEnabled(ui->radioSmartFee->isChecked());
|
ui->labelFeeEstimation ->setEnabled(ui->radioSmartFee->isChecked());
|
||||||
ui->checkBoxMinimumFee ->setEnabled(ui->radioCustomFee->isChecked());
|
ui->labelCustomFeeWarning ->setEnabled(ui->radioCustomFee->isChecked());
|
||||||
ui->labelMinFeeWarning ->setEnabled(ui->radioCustomFee->isChecked());
|
ui->labelCustomPerKilobyte ->setEnabled(ui->radioCustomFee->isChecked());
|
||||||
ui->labelCustomPerKilobyte ->setEnabled(ui->radioCustomFee->isChecked() && !ui->checkBoxMinimumFee->isChecked());
|
ui->customFee ->setEnabled(ui->radioCustomFee->isChecked());
|
||||||
ui->customFee ->setEnabled(ui->radioCustomFee->isChecked() && !ui->checkBoxMinimumFee->isChecked());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendCoinsDialog::updateFeeMinimizedLabel()
|
void SendCoinsDialog::updateFeeMinimizedLabel()
|
||||||
|
@ -672,14 +663,6 @@ void SendCoinsDialog::updateFeeMinimizedLabel()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
void SendCoinsDialog::updateCoinControlState(CCoinControl& ctrl)
|
||||||
{
|
{
|
||||||
if (ui->radioCustomFee->isChecked()) {
|
if (ui->radioCustomFee->isChecked()) {
|
||||||
|
|
|
@ -92,9 +92,7 @@ private Q_SLOTS:
|
||||||
void coinControlClipboardBytes();
|
void coinControlClipboardBytes();
|
||||||
void coinControlClipboardLowOutput();
|
void coinControlClipboardLowOutput();
|
||||||
void coinControlClipboardChange();
|
void coinControlClipboardChange();
|
||||||
void setMinimumFee();
|
|
||||||
void updateFeeSectionControls();
|
void updateFeeSectionControls();
|
||||||
void updateMinFeeLabel();
|
|
||||||
void updateSmartFeeLabel();
|
void updateSmartFeeLabel();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
|
Loading…
Reference in a new issue