]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
TxBroadcast: close dialog on successful broadcast
authortobtoht <tob@featherwallet.org>
Thu, 19 Jan 2023 15:24:18 +0000 (16:24 +0100)
committertobtoht <tob@featherwallet.org>
Thu, 19 Jan 2023 15:24:18 +0000 (16:24 +0100)
src/dialog/TxBroadcastDialog.cpp

index 6f530d6906e0689bdb2014bd8609bcb3df58ba2a..b37daa8e9e6becaaf395ca6be9064380a1af09da 100644 (file)
@@ -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;