Bitcoin ABC
0.32.10
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
namespace
kernel
{
16
Context
*
g_context
;
17
18
Context::Context
() {
19
assert
(!
g_context
);
20
g_context
=
this
;
21
std::string sha256_algo =
SHA256AutoDetect
();
22
LogPrintf
(
"Using the '%s' SHA256 implementation\n"
, sha256_algo);
23
RandomInit
();
24
ECC_Start
();
25
}
26
27
Context::~Context
() {
28
ECC_Stop
();
29
assert
(
g_context
);
30
g_context
=
nullptr
;
31
}
32
33
}
// namespace kernel
context.h
ECC_Start
void ECC_Start()
Initialize the elliptic curve support.
Definition:
key.cpp:433
ECC_Stop
void ECC_Stop()
Deinitialize the elliptic curve support.
Definition:
key.cpp:450
key.h
logging.h
LogPrintf
#define LogPrintf(...)
Definition:
logging.h:424
kernel
Definition:
init.h:28
kernel::g_context
Context * g_context
Global pointer to kernel::Context for legacy code.
Definition:
context.cpp:16
pubkey.h
RandomInit
void RandomInit()
Overall design of the RNG and entropy sources.
Definition:
random.cpp:796
SHA256AutoDetect
std::string SHA256AutoDetect()
Autodetect the best available SHA256 implementation.
Definition:
sha256.cpp:746
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:18
kernel::Context::~Context
~Context()
Definition:
context.cpp:27
assert
assert(!tx.IsCoinBase())
Generated on Sun Mar 8 2026 22:35:12 for Bitcoin ABC by
1.9.4