aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletcontroller.h
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2018-08-01 13:38:45 -0400
committerRussell Yanofsky <russ@yanofsky.org>2020-01-09 16:05:35 -0400
commit96cb597325f64cadb3cf43e2cdb3d7c1e2e49891 (patch)
tree8541d0f8d1c98dfaf761382f1c1379533a108040 /src/qt/walletcontroller.h
parente7f84503571c171a7e6728cd2d77dd4103bd7a6f (diff)
downloadbitcoin-96cb597325f64cadb3cf43e2cdb3d7c1e2e49891.tar.xz
gui: Avoid redundant tx status updates
In TransactionTablePriv::index, avoid calling interfaces::Wallet::tryGetTxStatus if the status is up to date as of the most recent NotifyBlockTip notification. Store height from the most recent notification in a new ClientModel::cachedNumBlocks variable in order to check this. This avoids floods of IPC traffic from tryGetTxStatus with #10102 when there are a lot of transactions. It might also make the GUI a little more efficient even when there is no IPC.
Diffstat (limited to 'src/qt/walletcontroller.h')
-rw-r--r--src/qt/walletcontroller.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qt/walletcontroller.h b/src/qt/walletcontroller.h
index 956245775e..f3d994949f 100644
--- a/src/qt/walletcontroller.h
+++ b/src/qt/walletcontroller.h
@@ -21,6 +21,7 @@
#include <QTimer>
#include <QString>
+class ClientModel;
class OptionsModel;
class PlatformStyle;
class WalletModel;
@@ -47,7 +48,7 @@ class WalletController : public QObject
void removeAndDeleteWallet(WalletModel* wallet_model);
public:
- WalletController(interfaces::Node& node, const PlatformStyle* platform_style, OptionsModel* options_model, QObject* parent);
+ WalletController(ClientModel& client_model, const PlatformStyle* platform_style, QObject* parent);
~WalletController();
//! Returns wallet models currently open.
@@ -70,6 +71,7 @@ Q_SIGNALS:
private:
QThread* const m_activity_thread;
QObject* const m_activity_worker;
+ ClientModel& m_client_model;
interfaces::Node& m_node;
const PlatformStyle* const m_platform_style;
OptionsModel* const m_options_model;