Display notifications for mining TX

This commit is contained in:
mcneb10 2024-08-20 21:20:51 -05:00
parent ba6113d9c0
commit 8114fc66ee
No known key found for this signature in database
GPG key ID: FB3485F57F0FE2E2

View file

@ -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<CoinsInfo*> 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);