Skip to content

Commit 7d03fee

Browse files
dongcarlryanofsky
andcommitted
kernel: Introduce empty and unused kernel::Context
[META] In the next commit, we will move the init::{Set,Unset}Globals logic into this struct. Co-Authored-By: Ryan Ofsky <[email protected]>
1 parent eeb4fc2 commit 7d03fee

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

src/Makefile.am

+1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ BITCOIN_CORE_H = \
172172
interfaces/wallet.h \
173173
kernel/chainstatemanager_opts.h \
174174
kernel/coinstats.h \
175+
kernel/context.h \
175176
key.h \
176177
key_io.h \
177178
logging.h \

src/kernel/context.h

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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

src/node/context.h

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#ifndef BITCOIN_NODE_CONTEXT_H
66
#define BITCOIN_NODE_CONTEXT_H
77

8+
#include <kernel/context.h>
9+
810
#include <cassert>
911
#include <functional>
1012
#include <memory>
@@ -39,6 +41,8 @@ namespace node {
3941
//! any member functions. It should just be a collection of references that can
4042
//! be used without pulling in unwanted dependencies or functionality.
4143
struct NodeContext {
44+
//! libbitcoin_kernel context
45+
std::unique_ptr<kernel::Context> kernel;
4246
//! Init interface for initializing current process and connecting to other processes.
4347
interfaces::Init* init{nullptr};
4448
std::unique_ptr<AddrMan> addrman;

0 commit comments

Comments
 (0)