Bitcoin Core
25.99.0
P2P Digital Currency
src
kernel
context.cpp
Go to the documentation of this file.
1
// Copyright (c) 2022 The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#include <
kernel/context.h
>
6
7
#include <
crypto/sha256.h
>
8
#include <
key.h
>
9
#include <logging.h>
10
#include <
pubkey.h
>
11
#include <random.h>
12
13
#include <string>
14
15
16
namespace
kernel
{
17
Context
*
g_context
;
18
19
Context::Context
()
20
{
21
assert
(!
g_context
);
22
g_context
=
this
;
23
std::string sha256_algo =
SHA256AutoDetect
();
24
LogPrintf
(
"Using the '%s' SHA256 implementation\n"
, sha256_algo);
25
RandomInit
();
26
ECC_Start
();
27
}
28
29
Context::~Context
()
30
{
31
ECC_Stop
();
32
assert
(
g_context
);
33
g_context
=
nullptr
;
34
}
35
36
}
// namespace kernel
ECC_Start
ECC_Start()
Definition:
key.cpp:429
RandomInit
RandomInit()
Definition:
random.cpp:679
ECC_Stop
ECC_Stop()
Definition:
key.cpp:446
context.h
key.h
LogPrintf
#define LogPrintf(...)
Definition:
logging.h:237
kernel
Definition:
coinstatsindex.h:13
kernel::g_context
Context * g_context
Global pointer to kernel::Context for legacy code.
Definition:
context.cpp:17
pubkey.h
SHA256AutoDetect
std::string SHA256AutoDetect()
Autodetect the best available SHA256 implementation.
Definition:
sha256.cpp:582
sha256.h
kernel::Context
Context struct holding the kernel library's logically global state, and passed to external libbitcoin...
Definition:
context.h:20
kernel::Context::Context
Context()
Declare default constructor and destructor that are not inline, so code instantiating the kernel::Con...
Definition:
context.cpp:19
kernel::Context::~Context
~Context()
Definition:
context.cpp:29
assert
assert(!tx.IsCoinBase())
Generated on Mon Oct 2 2023 20:02:34 for Bitcoin Core by
1.9.1