diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-07-14 11:48:21 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-07-14 21:53:09 +0300 |
commit | 19a1d008310f250b69b7aa764a9f26384d5a4a85 (patch) | |
tree | ae096361d7ea2a4b2eb50d0b1484c4c4ab5225ac /src/qt/bitcoin.h | |
parent | 531c2b7c04898f5a2097f44e8c12bfb2f53aaf9b (diff) |
qt: Add BitcoinCore::m_thread member
This change makes BitcoinCore self-contained to improve its
re-usability.
BitcoinApplication::coreThread member is now unused, and removed.
Diffstat (limited to 'src/qt/bitcoin.h')
-rw-r--r-- | src/qt/bitcoin.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/qt/bitcoin.h b/src/qt/bitcoin.h index f9fab0534b..d977062d6b 100644 --- a/src/qt/bitcoin.h +++ b/src/qt/bitcoin.h @@ -9,11 +9,14 @@ #include <config/bitcoin-config.h> #endif -#include <QApplication> +#include <interfaces/node.h> + #include <assert.h> #include <memory> +#include <optional> -#include <interfaces/node.h> +#include <QApplication> +#include <QThread> class BitcoinGUI; class ClientModel; @@ -34,6 +37,7 @@ class BitcoinCore: public QObject Q_OBJECT public: explicit BitcoinCore(interfaces::Node& node); + ~BitcoinCore(); public Q_SLOTS: void initialize(); @@ -49,6 +53,7 @@ private: void handleRunawayException(const std::exception *e); interfaces::Node& m_node; + QThread m_thread; }; /** Main Bitcoin application object */ @@ -112,7 +117,7 @@ Q_SIGNALS: void windowShown(BitcoinGUI* window); private: - QThread *coreThread; + std::optional<BitcoinCore> m_executor; OptionsModel *optionsModel; ClientModel *clientModel; BitcoinGUI *window; |