diff options
author | TheCharlatan <seb.kung@gmail.com> | 2024-01-15 12:55:31 +0100 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2024-05-09 15:56:08 +0200 |
commit | 41eba5bd716bea47c8731d156d053afee92a7f12 (patch) | |
tree | 23a01431d9155d7c82ede876e20cd579f0fd8286 /src/node | |
parent | a08d2b3cb971c68e9a50b991b2953fa4541cf48a (diff) | |
download | bitcoin-41eba5bd716bea47c8731d156d053afee92a7f12.tar.xz |
kernel: Remove key module from kernel library
The key module's functionality is not used by the kernel library, but
currently kernel users are still required to initialize the key module's
`secp256k1_context_sign` global as part of the `kernel::Context` through
`ECC_Start`.
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/context.cpp | 2 | ||||
-rw-r--r-- | src/node/context.h | 11 | ||||
-rw-r--r-- | src/node/interfaces.cpp | 2 | ||||
-rw-r--r-- | src/node/kernel_notifications.cpp | 1 |
4 files changed, 13 insertions, 3 deletions
diff --git a/src/node/context.cpp b/src/node/context.cpp index ca56fa0b86..e32d21b383 100644 --- a/src/node/context.cpp +++ b/src/node/context.cpp @@ -8,6 +8,7 @@ #include <banman.h> #include <interfaces/chain.h> #include <kernel/context.h> +#include <key.h> #include <net.h> #include <net_processing.h> #include <netgroup.h> @@ -16,6 +17,7 @@ #include <scheduler.h> #include <txmempool.h> #include <validation.h> +#include <validationinterface.h> namespace node { NodeContext::NodeContext() = default; diff --git a/src/node/context.h b/src/node/context.h index 245f230aec..a7d92989dd 100644 --- a/src/node/context.h +++ b/src/node/context.h @@ -5,10 +5,7 @@ #ifndef BITCOIN_NODE_CONTEXT_H #define BITCOIN_NODE_CONTEXT_H -#include <kernel/context.h> - #include <atomic> -#include <cassert> #include <cstdlib> #include <functional> #include <memory> @@ -24,6 +21,7 @@ class ValidationSignals; class CScheduler; class CTxMemPool; class ChainstateManager; +class ECC_Context; class NetGroupManager; class PeerManager; namespace interfaces { @@ -32,6 +30,12 @@ class ChainClient; class Init; class WalletLoader; } // namespace interfaces +namespace kernel { +struct Context; +} +namespace util { +class SignalInterrupt; +} namespace node { class KernelNotifications; @@ -49,6 +53,7 @@ class KernelNotifications; struct NodeContext { //! libbitcoin_kernel context std::unique_ptr<kernel::Context> kernel; + std::unique_ptr<ECC_Context> ecc_context; //! Init interface for initializing current process and connecting to other processes. interfaces::Init* init{nullptr}; //! Interrupt object used to track whether node shutdown was requested. diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index 84fc92e69d..c886357a34 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -17,6 +17,7 @@ #include <interfaces/node.h> #include <interfaces/wallet.h> #include <kernel/chain.h> +#include <kernel/context.h> #include <kernel/mempool_entry.h> #include <logging.h> #include <mapport.h> @@ -99,6 +100,7 @@ public: if (!AppInitParameterInteraction(args())) return false; m_context->kernel = std::make_unique<kernel::Context>(); + m_context->ecc_context = std::make_unique<ECC_Context>(); if (!AppInitSanityChecks(*m_context->kernel)) return false; if (!AppInitLockDataDirectory()) return false; diff --git a/src/node/kernel_notifications.cpp b/src/node/kernel_notifications.cpp index 6578b383f7..e326d4a1f2 100644 --- a/src/node/kernel_notifications.cpp +++ b/src/node/kernel_notifications.cpp @@ -14,6 +14,7 @@ #include <node/abort.h> #include <node/interface_ui.h> #include <util/check.h> +#include <util/signalinterrupt.h> #include <util/strencodings.h> #include <util/string.h> #include <util/translation.h> |