Bitcoin Core  22.0.0
P2P Digital Currency
bitcoind.cpp
Go to the documentation of this file.
1 // Copyright (c) 2021 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <interfaces/init.h>
6 #include <node/context.h>
7 #include <util/system.h>
8 
9 #include <memory>
10 
11 namespace init {
12 namespace {
13 class BitcoindInit : public interfaces::Init
14 {
15 public:
16  BitcoindInit(NodeContext& node) : m_node(node)
17  {
18  m_node.args = &gArgs;
19  m_node.init = this;
20  }
22 };
23 } // namespace
24 } // namespace init
25 
26 namespace interfaces {
27 std::unique_ptr<Init> MakeNodeInit(NodeContext& node, int argc, char* argv[], int& exit_status)
28 {
29  return std::make_unique<init::BitcoindInit>(node);
30 }
31 } // namespace interfaces
interfaces::Init * init
Init interface for initializing current process and connecting to other processes.
Definition: context.h:41
NodeContext struct containing references to chain state and connection state.
Definition: context.h:39
std::unique_ptr< Init > MakeNodeInit(NodeContext &node, int argc, char *argv[], int &exit_status)
Return implementation of Init interface for the node process.
NodeContext & m_node
Definition: bitcoind.cpp:21
ArgsManager * args
Definition: context.h:49
ArgsManager gArgs
Definition: system.cpp:84
Initial interface created when a process is first started, and used to give and get access to other i...
Definition: init.h:26