Skip to content

Commit 95a9383

Browse files
committed
[Qt] Remove CENT-fee-rule from coin control completely
1 parent 96f6f71 commit 95a9383

File tree

4 files changed

+10
-22
lines changed

4 files changed

+10
-22
lines changed

src/qt/coincontroldialog.cpp

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ CoinControlDialog::CoinControlDialog(QWidget *parent) :
7171
QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this);
7272
QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this);
7373
QAction *clipboardPriorityAction = new QAction(tr("Copy priority"), this);
74-
QAction *clipboardLowOutputAction = new QAction(tr("Copy low output"), this);
74+
QAction *clipboardLowOutputAction = new QAction(tr("Copy dust"), this);
7575
QAction *clipboardChangeAction = new QAction(tr("Copy change"), this);
7676

7777
connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(clipboardQuantity()));
@@ -309,7 +309,7 @@ void CoinControlDialog::clipboardPriority()
309309
GUIUtil::setClipboard(ui->labelCoinControlPriority->text());
310310
}
311311

312-
// copy label "Low output" to clipboard
312+
// copy label "Dust" to clipboard
313313
void CoinControlDialog::clipboardLowOutput()
314314
{
315315
GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text());
@@ -439,7 +439,6 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
439439

440440
// nPayAmount
441441
qint64 nPayAmount = 0;
442-
bool fLowOutput = false;
443442
bool fDust = false;
444443
CTransaction txDummy;
445444
foreach(const qint64 &amount, CoinControlDialog::payAmounts)
@@ -448,9 +447,6 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
448447

449448
if (amount > 0)
450449
{
451-
if (amount < CENT)
452-
fLowOutput = true;
453-
454450
CTxOut txout(amount, (CScript)vector<unsigned char>(24, 0));
455451
txDummy.vout.push_back(txout);
456452
if (txout.IsDust(CTransaction::minRelayTxFee))
@@ -571,7 +567,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
571567
QLabel *l7 = dialog->findChild<QLabel *>("labelCoinControlLowOutput");
572568
QLabel *l8 = dialog->findChild<QLabel *>("labelCoinControlChange");
573569

574-
// enable/disable "low output" and "change"
570+
// enable/disable "dust" and "change"
575571
dialog->findChild<QLabel *>("labelCoinControlLowOutputText")->setEnabled(nPayAmount > 0);
576572
dialog->findChild<QLabel *>("labelCoinControlLowOutput") ->setEnabled(nPayAmount > 0);
577573
dialog->findChild<QLabel *>("labelCoinControlChangeText") ->setEnabled(nPayAmount > 0);
@@ -584,14 +580,13 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
584580
l4->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nAfterFee)); // After Fee
585581
l5->setText(((nBytes > 0) ? "~" : "") + QString::number(nBytes)); // Bytes
586582
l6->setText(sPriorityLabel); // Priority
587-
l7->setText((fLowOutput ? (fDust ? tr("Dust") : tr("yes")) : tr("no"))); // Low Output / Dust
583+
l7->setText(fDust ? tr("yes") : tr("no")); // Dust
588584
l8->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nChange)); // Change
589585

590586
// turn labels "red"
591587
l5->setStyleSheet((nBytes >= 1000) ? "color:red;" : ""); // Bytes >= 1000
592588
l6->setStyleSheet((dPriority > 0 && !AllowFree(dPriority)) ? "color:red;" : ""); // Priority < "medium"
593-
l7->setStyleSheet((fLowOutput) ? "color:red;" : ""); // Low Output = "yes"
594-
l8->setStyleSheet((nChange > 0 && nChange < CENT) ? "color:red;" : ""); // Change < 0.01BTC
589+
l7->setStyleSheet((fDust) ? "color:red;" : ""); // Dust = "yes"
595590

596591
// tool tips
597592
QString toolTip1 = tr("This label turns red, if the transaction size is greater than 1000 bytes.") + "<br /><br />";
@@ -602,21 +597,14 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
602597
toolTip2 += tr("This label turns red, if the priority is smaller than \"medium\".") + "<br /><br />";
603598
toolTip2 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK()));
604599

605-
QString toolTip3 = tr("This label turns red, if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CENT)) + "<br /><br />";
606-
toolTip3 += tr("This means a fee of at least %1 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK())) + "<br /><br />";
607-
toolTip3 += tr("Amounts below 0.546 times the minimum relay fee are shown as dust.");
608-
609-
QString toolTip4 = tr("This label turns red, if the change is smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CENT)) + "<br /><br />";
610-
toolTip4 += tr("This means a fee of at least %1 is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minTxFee.GetFeePerK()));
600+
QString toolTip3 = tr("This label turns red, if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CTransaction::minRelayTxFee.GetFee(546)));
611601

612602
l5->setToolTip(toolTip1);
613603
l6->setToolTip(toolTip2);
614604
l7->setToolTip(toolTip3);
615-
l8->setToolTip(toolTip4);
616605
dialog->findChild<QLabel *>("labelCoinControlBytesText") ->setToolTip(l5->toolTip());
617606
dialog->findChild<QLabel *>("labelCoinControlPriorityText") ->setToolTip(l6->toolTip());
618607
dialog->findChild<QLabel *>("labelCoinControlLowOutputText")->setToolTip(l7->toolTip());
619-
dialog->findChild<QLabel *>("labelCoinControlChangeText") ->setToolTip(l8->toolTip());
620608

621609
// Insufficient funds
622610
QLabel *label = dialog->findChild<QLabel *>("labelCoinControlInsuffFunds");

src/qt/forms/coincontroldialog.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
</font>
226226
</property>
227227
<property name="text">
228-
<string>Low Output:</string>
228+
<string>Dust:</string>
229229
</property>
230230
</widget>
231231
</item>

src/qt/forms/sendcoinsdialog.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@
417417
</font>
418418
</property>
419419
<property name="text">
420-
<string>Low Output:</string>
420+
<string>Dust:</string>
421421
</property>
422422
</widget>
423423
</item>

src/qt/sendcoinsdialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
5353
QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this);
5454
QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this);
5555
QAction *clipboardPriorityAction = new QAction(tr("Copy priority"), this);
56-
QAction *clipboardLowOutputAction = new QAction(tr("Copy low output"), this);
56+
QAction *clipboardLowOutputAction = new QAction(tr("Copy dust"), this);
5757
QAction *clipboardChangeAction = new QAction(tr("Copy change"), this);
5858
connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardQuantity()));
5959
connect(clipboardAmountAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardAmount()));
@@ -478,7 +478,7 @@ void SendCoinsDialog::coinControlClipboardPriority()
478478
GUIUtil::setClipboard(ui->labelCoinControlPriority->text());
479479
}
480480

481-
// Coin Control: copy label "Low output" to clipboard
481+
// Coin Control: copy label "Dust" to clipboard
482482
void SendCoinsDialog::coinControlClipboardLowOutput()
483483
{
484484
GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text());

0 commit comments

Comments
 (0)