From d9409615f39b071bd04eeea2a1aefe615bdf78a0 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 19 Jan 2023 16:24:18 +0100 Subject: [PATCH] TxBroadcast: close dialog on successful broadcast --- src/dialog/TxBroadcastDialog.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/dialog/TxBroadcastDialog.cpp b/src/dialog/TxBroadcastDialog.cpp index 6f530d6..b37daa8 100644 --- a/src/dialog/TxBroadcastDialog.cpp +++ b/src/dialog/TxBroadcastDialog.cpp @@ -46,15 +46,18 @@ void TxBroadcastDialog::broadcastTx() { } void TxBroadcastDialog::onApiResponse(const DaemonRpc::DaemonResponse &resp) { + if (resp.endpoint != DaemonRpc::Endpoint::SEND_RAW_TRANSACTION) { + return; + } + if (!resp.ok) { QMessageBox::warning(this, "Transaction broadcast", resp.status); return; } - if (resp.endpoint == DaemonRpc::Endpoint::SEND_RAW_TRANSACTION) { - QMessageBox::information(this, "Transaction broadcast", "Transaction submitted successfully.\n\n" - "If the transaction belongs to this wallet it may take several minutes before it shows up in the history tab."); - } + this->accept(); + QMessageBox::information(this, "Transaction broadcast", "Transaction submitted successfully.\n\n" + "If the transaction belongs to this wallet it may take several minutes before it shows up in the history tab."); } TxBroadcastDialog::~TxBroadcastDialog() = default;