Bitcoin Core
22.99.0
P2P Digital Currency
src
init
bitcoin-qt.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/chain.h
>
6
#include <
interfaces/echo.h
>
7
#include <
interfaces/init.h
>
8
#include <
interfaces/node.h
>
9
#include <
interfaces/wallet.h
>
10
#include <
node/context.h
>
11
#include <
util/system.h
>
12
13
#include <memory>
14
15
namespace
init
{
16
namespace
{
17
class
BitcoinQtInit :
public
interfaces::Init
18
{
19
public
:
20
BitcoinQtInit()
21
{
22
m_node
.
args
= &
gArgs
;
23
m_node
.
init
=
this
;
24
}
25
std::unique_ptr<interfaces::Node> makeNode()
override
{
return
interfaces::MakeNode
(
m_node
); }
26
std::unique_ptr<interfaces::Chain> makeChain()
override
{
return
interfaces::MakeChain
(
m_node
); }
27
std::unique_ptr<interfaces::WalletLoader> makeWalletLoader(
interfaces::Chain
& chain)
override
28
{
29
return
MakeWalletLoader
(chain, *
Assert
(
m_node
.
args
));
30
}
31
std::unique_ptr<interfaces::Echo> makeEcho()
override
{
return
interfaces::MakeEcho
(); }
32
node::NodeContext
m_node
;
33
};
34
}
// namespace
35
}
// namespace init
36
37
namespace
interfaces
{
38
std::unique_ptr<Init>
MakeGuiInit
(
int
argc,
char
* argv[])
39
{
40
return
std::make_unique<init::BitcoinQtInit>();
41
}
42
}
// namespace interfaces
interfaces::MakeChain
std::unique_ptr< Chain > MakeChain(node::NodeContext &node)
Return implementation of Chain interface.
Definition:
interfaces.cpp:728
interfaces
Definition:
dummywallet.cpp:10
m_node
node::NodeContext m_node
Definition:
bitcoin-qt.cpp:32
node::NodeContext
NodeContext struct containing references to chain state and connection state.
Definition:
context.h:40
interfaces::Init
Initial interface created when a process is first started, and used to give and get access to other i...
Definition:
init.h:28
chain.h
context.h
interfaces::MakeGuiInit
std::unique_ptr< Init > MakeGuiInit(int argc, char *argv[])
Return implementation of Init interface for the gui process.
Definition:
bitcoin-gui.cpp:43
Assert
#define Assert(val)
Identity function.
Definition:
check.h:57
interfaces::Chain
Interface giving clients (wallet processes, maybe other analysis tools in the future) ability to acce...
Definition:
chain.h:94
echo.h
node.h
interfaces::MakeNode
std::unique_ptr< Node > MakeNode(node::NodeContext &context)
Return implementation of Node interface.
Definition:
interfaces.cpp:727
init.h
node::NodeContext::init
interfaces::Init * init
Init interface for initializing current process and connecting to other processes.
Definition:
context.h:42
interfaces::MakeEcho
std::unique_ptr< Echo > MakeEcho()
Return implementation of Echo interface.
Definition:
echo.cpp:17
gArgs
ArgsManager gArgs
Definition:
system.cpp:87
node::NodeContext::args
ArgsManager * args
Definition:
context.h:50
system.h
init
Definition:
bitcoin-gui.cpp:16
wallet.h
interfaces::MakeWalletLoader
std::unique_ptr< WalletLoader > MakeWalletLoader(Chain &chain, ArgsManager &args)
Return implementation of ChainClient interface for a wallet loader.
Definition:
dummywallet.cpp:61
Generated on Fri Feb 18 2022 20:03:18 for Bitcoin Core by
1.8.17