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`.
This commit is contained in:
TheCharlatan
2024-01-15 12:55:31 +01:00
parent a08d2b3cb9
commit 41eba5bd71
14 changed files with 31 additions and 21 deletions

View File

@@ -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;

View File

@@ -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.

View File

@@ -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;

View File

@@ -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>