Bitcoin Core
25.99.0
P2P Digital Currency
src
kernel
checks.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/checks.h
>
6
7
#include <
key.h
>
8
#include <random.h>
9
#include <
util/time.h
>
10
#include <
util/translation.h
>
11
12
#include <memory>
13
14
namespace
kernel
{
15
16
util::Result<void>
SanityChecks
(
const
Context
&)
17
{
18
if
(!
ECC_InitSanityCheck
()) {
19
return
util::Error
{
Untranslated
(
"Elliptic curve cryptography sanity check failure. Aborting."
)};
20
}
21
22
if
(!
Random_SanityCheck
()) {
23
return
util::Error
{
Untranslated
(
"OS cryptographic RNG sanity check failure. Aborting."
)};
24
}
25
26
if
(!
ChronoSanityCheck
()) {
27
return
util::Error
{
Untranslated
(
"Clock epoch mismatch. Aborting."
)};
28
}
29
30
return
{};
31
}
32
33
}
checks.h
util::Result< void >
ECC_InitSanityCheck
bool ECC_InitSanityCheck()
Check that required EC support is available at runtime.
Definition:
key.cpp:422
key.h
kernel
Definition:
coinstatsindex.h:13
kernel::SanityChecks
util::Result< void > SanityChecks(const Context &)
Ensure a usable environment with all necessary library support.
Definition:
checks.cpp:16
Random_SanityCheck
bool Random_SanityCheck()
Check that OS randomness is available and returning the requested number of bytes.
Definition:
random.cpp:613
kernel::Context
Context struct holding the kernel library's logically global state, and passed to external libbitcoin...
Definition:
context.h:20
util::Error
Definition:
result.h:15
ChronoSanityCheck
bool ChronoSanityCheck()
Sanity check epoch match normal Unix epoch.
Definition:
time.cpp:27
time.h
translation.h
Untranslated
bilingual_str Untranslated(std::string original)
Mark a bilingual_str as untranslated.
Definition:
translation.h:48
Generated on Mon Oct 2 2023 20:02:34 for Bitcoin Core by
1.9.1