mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-02 19:19:41 +01:00
-BEGIN VERIFY SCRIPT- sed --in-place --regexp-extended \ 's;( 20[0-2][0-9])(-20[0-2][0-9])? The Bitcoin Core developers;\1-present The Bitcoin Core developers;g' \ $( git grep -l 'The Bitcoin Core developers' -- ':(exclude)COPYING' ':(exclude)src/ipc/libmultiprocess' ':(exclude)src/minisketch' ) -END VERIFY SCRIPT-
27 lines
650 B
C++
27 lines
650 B
C++
// Copyright (c) 2022-present 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 <kernel/context.h>
|
|
|
|
#include <crypto/sha256.h>
|
|
#include <logging.h>
|
|
#include <random.h>
|
|
|
|
#include <mutex>
|
|
#include <string>
|
|
|
|
namespace kernel {
|
|
Context::Context()
|
|
{
|
|
static std::once_flag globals_initialized{};
|
|
std::call_once(globals_initialized, []() {
|
|
std::string sha256_algo = SHA256AutoDetect();
|
|
LogInfo("Using the '%s' SHA256 implementation\n", sha256_algo);
|
|
RandomInit();
|
|
});
|
|
}
|
|
|
|
|
|
} // namespace kernel
|