mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Move common global init code to init/common
This commit is contained in:
parent
13d27b452d
commit
a67b54855b
4 changed files with 51 additions and 11 deletions
14
src/init.cpp
14
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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue