|
7 | 7 | #endif |
8 | 8 |
|
9 | 9 | #include <qt/bitcoin.h> |
10 | | -#include <qt/bitcoingui.h> |
11 | 10 |
|
12 | 11 | #include <chainparams.h> |
| 12 | +#include <init.h> |
| 13 | +#include <interfaces/handler.h> |
| 14 | +#include <interfaces/node.h> |
| 15 | +#include <node/context.h> |
| 16 | +#include <node/ui_interface.h> |
| 17 | +#include <noui.h> |
| 18 | +#include <qt/bitcoincore.h> |
| 19 | +#include <qt/bitcoingui.h> |
13 | 20 | #include <qt/clientmodel.h> |
14 | 21 | #include <qt/guiconstants.h> |
15 | 22 | #include <qt/guiutil.h> |
|
20 | 27 | #include <qt/splashscreen.h> |
21 | 28 | #include <qt/utilitydialog.h> |
22 | 29 | #include <qt/winshutdownmonitor.h> |
| 30 | +#include <uint256.h> |
| 31 | +#include <util/system.h> |
| 32 | +#include <util/threadnames.h> |
| 33 | +#include <util/translation.h> |
| 34 | +#include <validation.h> |
23 | 35 |
|
24 | 36 | #ifdef ENABLE_WALLET |
25 | 37 | #include <qt/paymentserver.h> |
26 | 38 | #include <qt/walletcontroller.h> |
27 | 39 | #include <qt/walletmodel.h> |
28 | 40 | #endif // ENABLE_WALLET |
29 | 41 |
|
30 | | -#include <init.h> |
31 | | -#include <interfaces/handler.h> |
32 | | -#include <interfaces/node.h> |
33 | | -#include <node/context.h> |
34 | | -#include <node/ui_interface.h> |
35 | | -#include <noui.h> |
36 | | -#include <uint256.h> |
37 | | -#include <util/system.h> |
38 | | -#include <util/threadnames.h> |
39 | | -#include <util/translation.h> |
40 | | -#include <validation.h> |
41 | | - |
42 | 42 | #include <boost/signals2/connection.hpp> |
43 | 43 | #include <memory> |
44 | 44 |
|
@@ -155,58 +155,6 @@ void DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, cons |
155 | 155 | } |
156 | 156 | } |
157 | 157 |
|
158 | | -BitcoinCore::BitcoinCore(interfaces::Node& node) : |
159 | | - QObject(), m_node(node) |
160 | | -{ |
161 | | - this->moveToThread(&m_thread); |
162 | | - m_thread.start(); |
163 | | -} |
164 | | - |
165 | | -BitcoinCore::~BitcoinCore() |
166 | | -{ |
167 | | - qDebug() << __func__ << ": Stopping thread"; |
168 | | - m_thread.quit(); |
169 | | - m_thread.wait(); |
170 | | - qDebug() << __func__ << ": Stopped thread"; |
171 | | -} |
172 | | - |
173 | | -void BitcoinCore::handleRunawayException(const std::exception *e) |
174 | | -{ |
175 | | - PrintExceptionContinue(e, "Runaway exception"); |
176 | | - Q_EMIT runawayException(QString::fromStdString(m_node.getWarnings().translated)); |
177 | | -} |
178 | | - |
179 | | -void BitcoinCore::initialize() |
180 | | -{ |
181 | | - try |
182 | | - { |
183 | | - util::ThreadRename("qt-init"); |
184 | | - qDebug() << __func__ << ": Running initialization in thread"; |
185 | | - interfaces::BlockAndHeaderTipInfo tip_info; |
186 | | - bool rv = m_node.appInitMain(&tip_info); |
187 | | - Q_EMIT initializeResult(rv, tip_info); |
188 | | - } catch (const std::exception& e) { |
189 | | - handleRunawayException(&e); |
190 | | - } catch (...) { |
191 | | - handleRunawayException(nullptr); |
192 | | - } |
193 | | -} |
194 | | - |
195 | | -void BitcoinCore::shutdown() |
196 | | -{ |
197 | | - try |
198 | | - { |
199 | | - qDebug() << __func__ << ": Running Shutdown in thread"; |
200 | | - m_node.appShutdown(); |
201 | | - qDebug() << __func__ << ": Shutdown finished"; |
202 | | - Q_EMIT shutdownResult(); |
203 | | - } catch (const std::exception& e) { |
204 | | - handleRunawayException(&e); |
205 | | - } catch (...) { |
206 | | - handleRunawayException(nullptr); |
207 | | - } |
208 | | -} |
209 | | - |
210 | 158 | static int qt_argc = 1; |
211 | 159 | static const char* qt_argv = "bitcoin-qt"; |
212 | 160 |
|
|
0 commit comments