Browse Source

Change price refresh to 5min, quick update speed to 5s; more debugging

old_duke
Duke Leto 4 years ago
parent
commit
ac5b864daf
  1. 2
      src/main.cpp
  2. 8
      src/rpc.cpp
  3. 1
      src/sendtab.cpp
  4. 8
      src/settings.h

2
src/main.cpp

@ -1,5 +1,5 @@
// Copyright 2019-2020 The Hush developers
// GPLv3
// Released under the GPLv3
#include <singleapplication.h>
#include "precompiled.h"

8
src/rpc.cpp

@ -37,7 +37,7 @@ RPC::RPC(MainWindow* main) {
// Set up a timer to refresh the UI every few seconds
timer = new QTimer(main);
QObject::connect(timer, &QTimer::timeout, [=]() {
//qDebug() << "Refreshing main UI";
qDebug() << "Refreshing main UI";
refresh();
});
timer->start(Settings::updateSpeed);
@ -45,7 +45,7 @@ RPC::RPC(MainWindow* main) {
// Set up the timer to watch for tx status
txTimer = new QTimer(main);
QObject::connect(txTimer, &QTimer::timeout, [=]() {
//qDebug() << "Watching tx status";
qDebug() << "Watching tx status";
watchTxStatus();
});
// Start at every 10s. When an operation is pending, this will change to every second
@ -1001,7 +1001,7 @@ void RPC::watchTxStatus() {
watchingOps.remove(id);
wtx.completed(id, txid);
qDebug() << "opid "<< id << " started at "<<QString::number((unsigned int)it.toObject()["creation_time"].toInt()) << " took " << QString::number((double)it.toObject()["execution_secs"].toDouble()) << " seconds";
qDebug() << "opid "<< id << " for " << txid << " started at "<<QString::number((unsigned int)it.toObject()["creation_time"].toInt()) << " took " << QString::number((double)it.toObject()["execution_secs"].toDouble()) << " seconds";
// Refresh balances to show unconfirmed balances
refresh(true);
@ -1016,8 +1016,10 @@ void RPC::watchTxStatus() {
}
if (watchingOps.isEmpty()) {
qDebug() << "Using default update speed";
txTimer->start(Settings::updateSpeed);
} else {
qDebug() << "Using quick update speed";
txTimer->start(Settings::quickUpdateSpeed);
}
}

1
src/sendtab.cpp

@ -1,4 +1,5 @@
// Copyright 2019-2020 Hush developers
// Released under the GPLv3
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "addressbook.h"

8
src/settings.h

@ -1,4 +1,6 @@
// Copyright 2019 The Hush developers
// Copyright 2019-2020 The Hush developers
// Released under the GPLv3
#ifndef SETTINGS_H
#define SETTINGS_H
@ -142,8 +144,8 @@ public:
//TODO: add these as advanced options, with sane minimums
static const int updateSpeed = 10 * 1000; // 10 sec
static const int quickUpdateSpeed = 3 * 1000; // 3 sec
static const int priceRefreshSpeed = 15 * 60 * 1000; // 15 mins
static const int quickUpdateSpeed = 5 * 1000; // 5 sec
static const int priceRefreshSpeed = 5 * 60 * 1000; // 5 mins
private:
// This class can only be accessed through Settings::getInstance()

Loading…
Cancel
Save