Browse Source

Fixes for timer to not constantly poll z_getoperationstatus

pull/112/head
fekt 2 years ago
parent
commit
26a9788f7f
  1. 7
      src/rpc.cpp
  2. 5
      src/sendtab.cpp

7
src/rpc.cpp

@ -52,14 +52,13 @@ RPC::RPC(MainWindow* main) {
}); });
timer->start(Settings::updateSpeed); timer->start(Settings::updateSpeed);
// Set up the timer to watch for tx status // Set up the timer to watch for tx status
txTimer = new QTimer(main); txTimer = new QTimer(main);
QObject::connect(txTimer, &QTimer::timeout, [=]() { QObject::connect(txTimer, &QTimer::timeout, [=]() {
//qDebug() << "Watching tx status"; //qDebug() << "Watching tx status";
watchTxStatus(); watchTxStatus();
}); });
txTimer->start(Settings::updateSpeed);
qDebug() << __func__ << "Done settings up all timers"; qDebug() << __func__ << "Done settings up all timers";
usedAddresses = new QMap<QString, bool>(); usedAddresses = new QMap<QString, bool>();
@ -1180,8 +1179,10 @@ void RPC::watchTxStatus() {
} }
if (watchingOps.isEmpty()) { if (watchingOps.isEmpty()) {
txTimer->start(Settings::updateSpeed); // Stop the timer
txTimer->stop();
} else { } else {
// Keep polling for updates
txTimer->start(Settings::quickUpdateSpeed); txTimer->start(Settings::quickUpdateSpeed);
} }
} }

5
src/sendtab.cpp

@ -722,7 +722,7 @@ void MainWindow::sendButton() {
qDebug() << "Computing opid: " << opid; qDebug() << "Computing opid: " << opid;
}, },
[=] (QString, QString txid) { [=] (QString, QString txid) {
ui->statusBar->showMessage(Settings::txidStatusMessage + " " + txid); ui->statusBar->showMessage(Settings::txidStatusMessage + " " + txid);
connD->status->setText(tr("Done!")); connD->status->setText(tr("Done!"));
@ -737,7 +737,8 @@ void MainWindow::sendButton() {
// And switch to the balances tab // And switch to the balances tab
ui->tabWidget->setCurrentIndex(0); ui->tabWidget->setCurrentIndex(0);
}); });
// Force a UI update so we get the unconfirmed Tx
// Force a UI update so we get the unconfirmed Tx
rpc->refresh(true); rpc->refresh(true);
}, },
[=] (QString opid, QString errStr) { [=] (QString opid, QString errStr) {

Loading…
Cancel
Save