mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
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:
@@ -72,7 +72,7 @@ class NodeImpl : public Node
|
||||
private:
|
||||
ChainstateManager& chainman() { return *Assert(m_context->chainman); }
|
||||
public:
|
||||
explicit NodeImpl(NodeContext* context) { setContext(context); }
|
||||
explicit NodeImpl(NodeContext& context) { setContext(&context); }
|
||||
void initLogging() override { InitLogging(*Assert(m_context->args)); }
|
||||
void initParameterInteraction() override { InitParameterInteraction(*Assert(m_context->args)); }
|
||||
bilingual_str getWarnings() override { return GetWarnings(true); }
|
||||
@@ -701,6 +701,6 @@ public:
|
||||
} // namespace node
|
||||
|
||||
namespace interfaces {
|
||||
std::unique_ptr<Node> MakeNode(NodeContext* context) { return std::make_unique<node::NodeImpl>(context); }
|
||||
std::unique_ptr<Node> MakeNode(NodeContext& context) { return std::make_unique<node::NodeImpl>(context); }
|
||||
std::unique_ptr<Chain> MakeChain(NodeContext& context) { return std::make_unique<node::ChainImpl>(context); }
|
||||
} // namespace interfaces
|
||||
|
||||
Reference in New Issue
Block a user