From 2bc9b92ed8b7736ad67876398a0bb8287f57e9b3 Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Fri, 24 Apr 2020 18:06:26 -0400 Subject: Cancel wallet balance timer when shutdown requested This doesn't fix any current problem, but it makes balance checking code less fragile, and prevents use-after free travis error in next commit: https://travis-ci.org/github/bitcoin/bitcoin/jobs/675367629#L4240 --- src/qt/walletmodel.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/qt/walletmodel.h') diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 5521565f7c..23232ec66b 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -144,6 +144,7 @@ public: interfaces::Node& node() const { return m_node; } interfaces::Wallet& wallet() const { return *m_wallet; } + void setClientModel(ClientModel* client_model); int getNumBlocks() const { return cachedNumBlocks; } QString getWalletName() const; @@ -161,7 +162,7 @@ private: std::unique_ptr m_handler_show_progress; std::unique_ptr m_handler_watch_only_changed; std::unique_ptr m_handler_can_get_addrs_changed; - ClientModel& m_client_model; + ClientModel* m_client_model; interfaces::Node& m_node; bool fHaveWatchOnly; @@ -179,6 +180,7 @@ private: interfaces::WalletBalances m_cached_balances; EncryptionStatus cachedEncryptionStatus; int cachedNumBlocks; + QTimer* timer; void subscribeToCoreSignals(); void unsubscribeFromCoreSignals(); -- cgit v1.2.3