Skip to content

Commit 210ef1e

Browse files
committed
qt: remove confusing "Dust" label from coincontrol / sendcoins dialog
In contrast to to all other labels on the coin selection dialog, the displayed dust information has nothing to do with the selected coins. All that this label shows is whether at least one of the _outputs_ qualify as dust, but the outputs are set in a different dialog. (Even worse, the dust check is currently simply wrong because it only looks at an output's nValue and just assumes a P2PKH script size.) As the label clearly doesn't help the user and is, quite the contrary, rather increasing confusion/misguidance, it seems sensible to remove it. Also, remove the label from the sendcoins dialog with the same rationale.
1 parent f50fb17 commit 210ef1e

File tree

6 files changed

+2
-107
lines changed

6 files changed

+2
-107
lines changed

src/qt/coincontroldialog.cpp

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,20 @@ CoinControlDialog::CoinControlDialog(CCoinControl& coin_control, WalletModel* _m
7070
QAction *clipboardFeeAction = new QAction(tr("Copy fee"), this);
7171
QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this);
7272
QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this);
73-
QAction *clipboardLowOutputAction = new QAction(tr("Copy dust"), this);
7473
QAction *clipboardChangeAction = new QAction(tr("Copy change"), this);
7574

7675
connect(clipboardQuantityAction, &QAction::triggered, this, &CoinControlDialog::clipboardQuantity);
7776
connect(clipboardAmountAction, &QAction::triggered, this, &CoinControlDialog::clipboardAmount);
7877
connect(clipboardFeeAction, &QAction::triggered, this, &CoinControlDialog::clipboardFee);
7978
connect(clipboardAfterFeeAction, &QAction::triggered, this, &CoinControlDialog::clipboardAfterFee);
8079
connect(clipboardBytesAction, &QAction::triggered, this, &CoinControlDialog::clipboardBytes);
81-
connect(clipboardLowOutputAction, &QAction::triggered, this, &CoinControlDialog::clipboardLowOutput);
8280
connect(clipboardChangeAction, &QAction::triggered, this, &CoinControlDialog::clipboardChange);
8381

8482
ui->labelCoinControlQuantity->addAction(clipboardQuantityAction);
8583
ui->labelCoinControlAmount->addAction(clipboardAmountAction);
8684
ui->labelCoinControlFee->addAction(clipboardFeeAction);
8785
ui->labelCoinControlAfterFee->addAction(clipboardAfterFeeAction);
8886
ui->labelCoinControlBytes->addAction(clipboardBytesAction);
89-
ui->labelCoinControlLowOutput->addAction(clipboardLowOutputAction);
9087
ui->labelCoinControlChange->addAction(clipboardChangeAction);
9188

9289
// toggle tree/list mode
@@ -294,12 +291,6 @@ void CoinControlDialog::clipboardBytes()
294291
GUIUtil::setClipboard(ui->labelCoinControlBytes->text().replace(ASYMP_UTF8, ""));
295292
}
296293

297-
// copy label "Dust" to clipboard
298-
void CoinControlDialog::clipboardLowOutput()
299-
{
300-
GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text());
301-
}
302-
303294
// copy label "Change" to clipboard
304295
void CoinControlDialog::clipboardChange()
305296
{
@@ -390,17 +381,8 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel *
390381

391382
// nPayAmount
392383
CAmount nPayAmount = 0;
393-
bool fDust = false;
394-
for (const CAmount &amount : CoinControlDialog::payAmounts)
395-
{
384+
for (const CAmount &amount : CoinControlDialog::payAmounts) {
396385
nPayAmount += amount;
397-
398-
if (amount > 0)
399-
{
400-
// Assumes a p2pkh script size
401-
CTxOut txout(amount, CScript() << std::vector<unsigned char>(24, 0));
402-
fDust |= IsDust(txout, model->node().getDustRelayFee());
403-
}
404386
}
405387

406388
CAmount nAmount = 0;
@@ -516,12 +498,9 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel *
516498
QLabel *l3 = dialog->findChild<QLabel *>("labelCoinControlFee");
517499
QLabel *l4 = dialog->findChild<QLabel *>("labelCoinControlAfterFee");
518500
QLabel *l5 = dialog->findChild<QLabel *>("labelCoinControlBytes");
519-
QLabel *l7 = dialog->findChild<QLabel *>("labelCoinControlLowOutput");
520501
QLabel *l8 = dialog->findChild<QLabel *>("labelCoinControlChange");
521502

522-
// enable/disable "dust" and "change"
523-
dialog->findChild<QLabel *>("labelCoinControlLowOutputText")->setEnabled(nPayAmount > 0);
524-
dialog->findChild<QLabel *>("labelCoinControlLowOutput") ->setEnabled(nPayAmount > 0);
503+
// enable/disable "change"
525504
dialog->findChild<QLabel *>("labelCoinControlChangeText") ->setEnabled(nPayAmount > 0);
526505
dialog->findChild<QLabel *>("labelCoinControlChange") ->setEnabled(nPayAmount > 0);
527506

@@ -531,7 +510,6 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel *
531510
l3->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nPayFee)); // Fee
532511
l4->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nAfterFee)); // After Fee
533512
l5->setText(((nBytes > 0) ? ASYMP_UTF8 : "") + QString::number(nBytes)); // Bytes
534-
l7->setText(fDust ? tr("yes") : tr("no")); // Dust
535513
l8->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nChange)); // Change
536514
if (nPayFee > 0)
537515
{
@@ -541,25 +519,17 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel *
541519
l8->setText(ASYMP_UTF8 + l8->text());
542520
}
543521

544-
// turn label red when dust
545-
l7->setStyleSheet((fDust) ? "color:red;" : "");
546-
547-
// tool tips
548-
QString toolTipDust = tr("This label turns red if any recipient receives an amount smaller than the current dust threshold.");
549-
550522
// how many satoshis the estimated fee can vary per byte we guess wrong
551523
double dFeeVary = (nBytes != 0) ? (double)nPayFee / nBytes : 0;
552524

553525
QString toolTip4 = tr("Can vary +/- %1 satoshi(s) per input.").arg(dFeeVary);
554526

555527
l3->setToolTip(toolTip4);
556528
l4->setToolTip(toolTip4);
557-
l7->setToolTip(toolTipDust);
558529
l8->setToolTip(toolTip4);
559530
dialog->findChild<QLabel *>("labelCoinControlFeeText") ->setToolTip(l3->toolTip());
560531
dialog->findChild<QLabel *>("labelCoinControlAfterFeeText") ->setToolTip(l4->toolTip());
561532
dialog->findChild<QLabel *>("labelCoinControlBytesText") ->setToolTip(l5->toolTip());
562-
dialog->findChild<QLabel *>("labelCoinControlLowOutputText")->setToolTip(l7->toolTip());
563533
dialog->findChild<QLabel *>("labelCoinControlChangeText") ->setToolTip(l8->toolTip());
564534

565535
// Insufficient funds

src/qt/coincontroldialog.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ private Q_SLOTS:
105105
void clipboardFee();
106106
void clipboardAfterFee();
107107
void clipboardBytes();
108-
void clipboardLowOutput();
109108
void clipboardChange();
110109
void radioTreeMode(bool);
111110
void radioListMode(bool);

src/qt/forms/coincontroldialog.ui

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -139,41 +139,6 @@
139139
</property>
140140
</widget>
141141
</item>
142-
<item row="1" column="0">
143-
<widget class="QLabel" name="labelCoinControlLowOutputText">
144-
<property name="enabled">
145-
<bool>false</bool>
146-
</property>
147-
<property name="font">
148-
<font>
149-
<weight>75</weight>
150-
<bold>true</bold>
151-
</font>
152-
</property>
153-
<property name="text">
154-
<string>Dust:</string>
155-
</property>
156-
</widget>
157-
</item>
158-
<item row="1" column="1">
159-
<widget class="QLabel" name="labelCoinControlLowOutput">
160-
<property name="enabled">
161-
<bool>false</bool>
162-
</property>
163-
<property name="cursor">
164-
<cursorShape>IBeamCursor</cursorShape>
165-
</property>
166-
<property name="contextMenuPolicy">
167-
<enum>Qt::ActionsContextMenu</enum>
168-
</property>
169-
<property name="text">
170-
<string notr="true">no</string>
171-
</property>
172-
<property name="textInteractionFlags">
173-
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
174-
</property>
175-
</widget>
176-
</item>
177142
</layout>
178143
</item>
179144
<item>

src/qt/forms/sendcoinsdialog.ui

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -331,35 +331,6 @@
331331
</property>
332332
</widget>
333333
</item>
334-
<item row="1" column="0">
335-
<widget class="QLabel" name="labelCoinControlLowOutputText">
336-
<property name="font">
337-
<font>
338-
<weight>75</weight>
339-
<bold>true</bold>
340-
</font>
341-
</property>
342-
<property name="text">
343-
<string>Dust:</string>
344-
</property>
345-
</widget>
346-
</item>
347-
<item row="1" column="1">
348-
<widget class="QLabel" name="labelCoinControlLowOutput">
349-
<property name="cursor">
350-
<cursorShape>IBeamCursor</cursorShape>
351-
</property>
352-
<property name="contextMenuPolicy">
353-
<enum>Qt::ActionsContextMenu</enum>
354-
</property>
355-
<property name="text">
356-
<string notr="true">no</string>
357-
</property>
358-
<property name="textInteractionFlags">
359-
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
360-
</property>
361-
</widget>
362-
</item>
363334
</layout>
364335
</item>
365336
<item>

src/qt/sendcoinsdialog.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,18 @@ SendCoinsDialog::SendCoinsDialog(const PlatformStyle *_platformStyle, QWidget *p
9797
QAction *clipboardFeeAction = new QAction(tr("Copy fee"), this);
9898
QAction *clipboardAfterFeeAction = new QAction(tr("Copy after fee"), this);
9999
QAction *clipboardBytesAction = new QAction(tr("Copy bytes"), this);
100-
QAction *clipboardLowOutputAction = new QAction(tr("Copy dust"), this);
101100
QAction *clipboardChangeAction = new QAction(tr("Copy change"), this);
102101
connect(clipboardQuantityAction, &QAction::triggered, this, &SendCoinsDialog::coinControlClipboardQuantity);
103102
connect(clipboardAmountAction, &QAction::triggered, this, &SendCoinsDialog::coinControlClipboardAmount);
104103
connect(clipboardFeeAction, &QAction::triggered, this, &SendCoinsDialog::coinControlClipboardFee);
105104
connect(clipboardAfterFeeAction, &QAction::triggered, this, &SendCoinsDialog::coinControlClipboardAfterFee);
106105
connect(clipboardBytesAction, &QAction::triggered, this, &SendCoinsDialog::coinControlClipboardBytes);
107-
connect(clipboardLowOutputAction, &QAction::triggered, this, &SendCoinsDialog::coinControlClipboardLowOutput);
108106
connect(clipboardChangeAction, &QAction::triggered, this, &SendCoinsDialog::coinControlClipboardChange);
109107
ui->labelCoinControlQuantity->addAction(clipboardQuantityAction);
110108
ui->labelCoinControlAmount->addAction(clipboardAmountAction);
111109
ui->labelCoinControlFee->addAction(clipboardFeeAction);
112110
ui->labelCoinControlAfterFee->addAction(clipboardAfterFeeAction);
113111
ui->labelCoinControlBytes->addAction(clipboardBytesAction);
114-
ui->labelCoinControlLowOutput->addAction(clipboardLowOutputAction);
115112
ui->labelCoinControlChange->addAction(clipboardChangeAction);
116113

117114
// init transaction fee section
@@ -904,12 +901,6 @@ void SendCoinsDialog::coinControlClipboardBytes()
904901
GUIUtil::setClipboard(ui->labelCoinControlBytes->text().replace(ASYMP_UTF8, ""));
905902
}
906903

907-
// Coin Control: copy label "Dust" to clipboard
908-
void SendCoinsDialog::coinControlClipboardLowOutput()
909-
{
910-
GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text());
911-
}
912-
913904
// Coin Control: copy label "Change" to clipboard
914905
void SendCoinsDialog::coinControlClipboardChange()
915906
{

src/qt/sendcoinsdialog.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ private Q_SLOTS:
108108
void coinControlClipboardFee();
109109
void coinControlClipboardAfterFee();
110110
void coinControlClipboardBytes();
111-
void coinControlClipboardLowOutput();
112111
void coinControlClipboardChange();
113112
void updateFeeSectionControls();
114113
void updateNumberOfBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, SyncType synctype, SynchronizationState sync_state);

0 commit comments

Comments
 (0)