diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2017-12-05 15:57:12 -0500 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2021-08-17 03:05:15 -0500 |
commit | e4709c7b56612553fb7cbf16ef2d5099c5b732d0 (patch) | |
tree | 3184f2fcce535f256d986e94b8d5b359223db150 /src/node | |
parent | fdd80b0a53b4af0b29cb6e03118e2456d053a757 (diff) | |
download | bitcoin-e4709c7b56612553fb7cbf16ef2d5099c5b732d0.tar.xz |
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.)
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/interfaces.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index 183b5a5d91..1f6f502473 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -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 |