Bitcoin Core  21.99.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 
8 #include <memory>
9 
10 namespace init {
11 namespace {
12 class BitcoindInit : public interfaces::Init
13 {
14 public:
15  BitcoindInit(NodeContext& node) : m_node(node)
16  {
17  m_node.init = this;
18  }
20 };
21 } // namespace
22 } // namespace init
23 
24 namespace interfaces {
25 std::unique_ptr<Init> MakeNodeInit(NodeContext& node, int argc, char* argv[], int& exit_status)
26 {
27  return std::make_unique<init::BitcoindInit>(node);
28 }
29 } // namespace interfaces
interfaces
Definition: dummywallet.cpp:10
interfaces::Init
Initial interface created when a process is first started, and used to give and get access to other i...
Definition: init.h:26
m_node
NodeContext & m_node
Definition: bitcoind.cpp:19
context.h
NodeContext::init
interfaces::Init * init
Init interface for initializing current process and connecting to other processes.
Definition: context.h:41
init.h
init
Definition: bitcoin-node.cpp:12
node
Definition: interfaces.cpp:66
interfaces::MakeNodeInit
std::unique_ptr< Init > MakeNodeInit(NodeContext &node, int argc, char *argv[], int &exit_status)
Return implementation of Init interface for the node process.
Definition: bitcoin-node.cpp:34
NodeContext
NodeContext struct containing references to chain state and connection state.
Definition: context.h:39