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
30
src/init/common.cpp
Normal file
30
src/init/common.cpp
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (c) 2021 The Bitcoin Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <crypto/sha256.h>
|
||||
#include <key.h>
|
||||
#include <logging.h>
|
||||
#include <pubkey.h>
|
||||
#include <random.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
static std::unique_ptr<ECCVerifyHandle> globalVerifyHandle;
|
||||
|
||||
namespace init {
|
||||
void SetGlobals()
|
||||
{
|
||||
std::string sha256_algo = SHA256AutoDetect();
|
||||
LogPrintf("Using the '%s' SHA256 implementation\n", sha256_algo);
|
||||
RandomInit();
|
||||
ECC_Start();
|
||||
globalVerifyHandle.reset(new ECCVerifyHandle());
|
||||
}
|
||||
|
||||
void UnsetGlobals()
|
||||
{
|
||||
globalVerifyHandle.reset();
|
||||
ECC_Stop();
|
||||
}
|
||||
} // namespace init
|
||||
Loading…
Add table
Add a link
Reference in a new issue