diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 3c331c70ef..89bd35eb1b 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -406,6 +406,7 @@ void SendCoinsDialog::presentPSBT(PartiallySignedTransaction& psbtx) msgBox.setInformativeText(tr("The PSBT has been copied to the clipboard. You can also save it.")); msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard); msgBox.setDefaultButton(QMessageBox::Discard); + msgBox.setObjectName("psbt_copied_message"); switch (msgBox.exec()) { case QMessageBox::Save: { QString selectedFilter; diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp index f5b86f44a6..603df0b15f 100644 --- a/src/qt/test/wallettests.cpp +++ b/src/qt/test/wallettests.cpp @@ -418,7 +418,7 @@ void TestGUIWatchOnly(interfaces::Node& node, TestChain100Setup& test) timer.setInterval(500); QObject::connect(&timer, &QTimer::timeout, [&](){ for (QWidget* widget : QApplication::topLevelWidgets()) { - if (widget->inherits("QMessageBox")) { + if (widget->inherits("QMessageBox") && widget->objectName().compare("psbt_copied_message") == 0) { QMessageBox* dialog = qobject_cast(widget); QAbstractButton* button = dialog->button(QMessageBox::Discard); button->setEnabled(true);