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