From 12660e3634c9bab7633593f3ce1c07b6cadb1785 Mon Sep 17 00:00:00 2001 From: jamescowens Date: Sat, 31 Jul 2021 21:57:42 -0400 Subject: [PATCH] Prevent pasting (no label) as label in consolidation transaction --- src/qt/sendcoinsdialog.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 2ec584f34c..7ed3d6cf92 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -490,8 +490,6 @@ void SendCoinsDialog::coinControlConsolidateWizardButtonClicked() void SendCoinsDialog::selectedConsolidationRecipient(SendCoinsRecipient consolidationRecipient) { - LogPrintf("INFO: %s: SLOT called.", __func__); - ui->coinControlChangeCheckBox->setChecked(true); ui->coinControlChangeEdit->setText(consolidationRecipient.address); @@ -505,6 +503,12 @@ void SendCoinsDialog::selectedConsolidationRecipient(SendCoinsRecipient consolid } } + // The AddressTableModel substitutes the translated "(no label)" when the label is empty. If we use + // that here, we will end up pasting a literal lable of "(no label)". Because the translation (tr) should + // be consistent between here and the AddressTableModel::data, it should match the conditional and be put + // back to the desired empty QString. + if (consolidationRecipient.label == tr("(no label)")) consolidationRecipient.label = QString(); + pasteEntry(consolidationRecipient); }