From 8114fc66ee25b9834d59ffded3d93c3a7929934c Mon Sep 17 00:00:00 2001 From: mcneb10 Date: Tue, 20 Aug 2024 21:20:51 -0500 Subject: [PATCH] Display notifications for mining TX --- src/MainWindow.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 44b6808..8ec6a48 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -482,6 +482,17 @@ void MainWindow::initWalletContext() { } }); + connect(m_wallet, &Wallet::moneyReceived, this, [this](const QString &txId, uint64_t amount){ + if (m_wallet->isSynchronized() && !m_locked) { + m_wallet->coins()->refresh(); + QVector new_tx_coins = m_wallet->coins()->coins_from_txid(txId); + if(new_tx_coins.size() > 0 && new_tx_coins.front()->coinbase()) { + auto notify = QString("%1 XMR (pending)").arg(WalletManager::displayAmount(amount, false)); + m_windowManager->notify("Mining payment received", notify, 5000); + } + } + }); + // Device connect(m_wallet, &Wallet::deviceButtonRequest, this, &MainWindow::onDeviceButtonRequest); connect(m_wallet, &Wallet::deviceButtonPressed, this, &MainWindow::onDeviceButtonPressed);