aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2021-04-18 18:56:12 -0400
committerRussell Yanofsky <russ@yanofsky.org>2021-04-19 06:11:38 -0400
commita67b54855b294802d52f09fa60d3f63550cbada7 (patch)
treed8a205566e506d7c18f77485a7ceaca3f942fd27 /src/init.cpp
parent13d27b452d4b60010c54d4f80757dea9805076be (diff)
downloadbitcoin-a67b54855b294802d52f09fa60d3f63550cbada7.tar.xz
Move common global init code to init/common
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 07e882c9df..4298494916 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -22,9 +22,9 @@
#include <httpserver.h>
#include <index/blockfilterindex.h>
#include <index/txindex.h>
+#include <init/common.h>
#include <interfaces/chain.h>
#include <interfaces/node.h>
-#include <key.h>
#include <mapport.h>
#include <miner.h>
#include <net.h>
@@ -151,8 +151,6 @@ static fs::path GetPidFile(const ArgsManager& args)
// shutdown thing.
//
-static std::unique_ptr<ECCVerifyHandle> globalVerifyHandle;
-
void Interrupt(NodeContext& node)
{
InterruptHTTPServer();
@@ -286,8 +284,7 @@ void Shutdown(NodeContext& node)
node.chain_clients.clear();
UnregisterAllValidationInterfaces();
GetMainSignals().UnregisterBackgroundSignalScheduler();
- globalVerifyHandle.reset();
- ECC_Stop();
+ init::UnsetGlobals();
node.mempool.reset();
node.fee_estimator.reset();
node.chainman = nullptr;
@@ -1148,12 +1145,7 @@ bool AppInitSanityChecks()
{
// ********************************************************* Step 4: sanity checks
- // Initialize elliptic curve code
- std::string sha256_algo = SHA256AutoDetect();
- LogPrintf("Using the '%s' SHA256 implementation\n", sha256_algo);
- RandomInit();
- ECC_Start();
- globalVerifyHandle.reset(new ECCVerifyHandle());
+ init::SetGlobals();
// Sanity check
if (!InitSanityCheck())