mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
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:
@@ -32,6 +32,8 @@
|
||||
#include <interfaces/chain.h>
|
||||
#include <interfaces/init.h>
|
||||
#include <interfaces/node.h>
|
||||
#include <kernel/context.h>
|
||||
#include <key.h>
|
||||
#include <logging.h>
|
||||
#include <mapport.h>
|
||||
#include <net.h>
|
||||
@@ -75,6 +77,7 @@
|
||||
#include <util/fs_helpers.h>
|
||||
#include <util/moneystr.h>
|
||||
#include <util/result.h>
|
||||
#include <util/signalinterrupt.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/string.h>
|
||||
#include <util/syserror.h>
|
||||
@@ -371,6 +374,7 @@ void Shutdown(NodeContext& node)
|
||||
node.chainman.reset();
|
||||
node.validation_signals.reset();
|
||||
node.scheduler.reset();
|
||||
node.ecc_context.reset();
|
||||
node.kernel.reset();
|
||||
|
||||
RemovePidFile(*node.args);
|
||||
@@ -1084,6 +1088,10 @@ bool AppInitSanityChecks(const kernel::Context& kernel)
|
||||
return InitError(strprintf(_("Initialization sanity check failed. %s is shutting down."), PACKAGE_NAME));
|
||||
}
|
||||
|
||||
if (!ECC_InitSanityCheck()) {
|
||||
return InitError(strprintf(_("Elliptic curve cryptography sanity check failure. %s is shutting down."), PACKAGE_NAME));
|
||||
}
|
||||
|
||||
// Probe the data directory lock to give an early error message, if possible
|
||||
// We cannot hold the data directory lock here, as the forking for daemon() hasn't yet happened,
|
||||
// and a fork will cause weird behavior to it.
|
||||
|
||||
Reference in New Issue
Block a user