File tree 3 files changed +25
-0
lines changed
3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ BITCOIN_CORE_H = \
172
172
interfaces/wallet.h \
173
173
kernel/chainstatemanager_opts.h \
174
174
kernel/coinstats.h \
175
+ kernel/context.h \
175
176
key.h \
176
177
key_io.h \
177
178
logging.h \
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 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
+ #ifndef BITCOIN_KERNEL_CONTEXT_H
6
+ #define BITCOIN_KERNEL_CONTEXT_H
7
+
8
+ namespace kernel {
9
+ // ! Context struct holding the kernel library's logically global state, and
10
+ // ! passed to external libbitcoin_kernel functions which need access to this
11
+ // ! state. The kernel libary API is a work in progress, so state organization
12
+ // ! and member list will evolve over time.
13
+ // !
14
+ // ! State stored directly in this struct should be simple. More complex state
15
+ // ! should be stored to std::unique_ptr members pointing to opaque types.
16
+ struct Context {
17
+ };
18
+ } // namespace kernel
19
+
20
+ #endif // BITCOIN_KERNEL_CONTEXT_H
Original file line number Diff line number Diff line change 5
5
#ifndef BITCOIN_NODE_CONTEXT_H
6
6
#define BITCOIN_NODE_CONTEXT_H
7
7
8
+ #include < kernel/context.h>
9
+
8
10
#include < cassert>
9
11
#include < functional>
10
12
#include < memory>
@@ -39,6 +41,8 @@ namespace node {
39
41
// ! any member functions. It should just be a collection of references that can
40
42
// ! be used without pulling in unwanted dependencies or functionality.
41
43
struct NodeContext {
44
+ // ! libbitcoin_kernel context
45
+ std::unique_ptr<kernel::Context> kernel;
42
46
// ! Init interface for initializing current process and connecting to other processes.
43
47
interfaces::Init* init{nullptr };
44
48
std::unique_ptr<AddrMan> addrman;
You can’t perform that action at this time.
0 commit comments