Start using init makeNode, makeChain, etc methods

Use interfaces::Init::make* methods instead of interfaces::Make*
functions, so interfaces can be constructed differently in different
executables without having to change any code. (So for example
bitcoin-gui can make an interfaces::Node pointer that communicates with
a bitcoin-node subprocess, while bitcoin-qt can make an interfaces::Node
pointer that starts node code in the same process.)
This commit is contained in:
Russell Yanofsky committed 2021-08-17 03:05:15 -05:00
1 parent fdd80b0a53
commit e4709c7b56
17 files changed
+63 -22

No files matched your search

+6 -2
View File
@@ -27,6 +27,9 @@ class PlatformStyle;
class SplashScreen;
class WalletController;
class WalletModel;
namespace interfaces {
class Init;
} // namespace interfaces
/** Main Bitcoin application object */
@@ -51,6 +54,8 @@ public:
void createWindow(const NetworkStyle *networkStyle);
/// Create splash screen
void createSplashScreen(const NetworkStyle *networkStyle);
/// Create or spawn node
void createNode(interfaces::Init& init);
/// Basic initialization, before starting initialization/shutdown thread. Return true on success.
bool baseInitialize();
@@ -69,7 +74,6 @@ public:
void setupPlatformStyle();
interfaces::Node& node() const { assert(m_node); return *m_node; }
void setNode(interfaces::Node& node);
public Q_SLOTS:
void initializeResult(bool success, interfaces::BlockAndHeaderTipInfo tip_info);
@@ -103,7 +107,7 @@ private:
const PlatformStyle *platformStyle;
std::unique_ptr<QWidget> shutdownWindow;
SplashScreen* m_splash = nullptr;
interfaces::Node* m_node = nullptr;
std::unique_ptr<interfaces::Node> m_node;
void startThread();
};