Bitcoin Core
28.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 <random.h>
8
#include <
util/result.h
>
9
#include <
util/translation.h
>
10
11
#include <memory>
12
13
namespace
kernel
{
14
15
util::Result<void>
SanityChecks
(
const
Context
&)
16
{
17
if
(!
Random_SanityCheck
()) {
18
return
util::Error
{
Untranslated
(
"OS cryptographic RNG sanity check failure. Aborting."
)};
19
}
20
21
return
{};
22
}
23
24
}
checks.h
util::Result< void >
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:15
Random_SanityCheck
bool Random_SanityCheck()
Check that OS randomness is available and returning the requested number of bytes.
Definition:
random.cpp:716
result.h
kernel::Context
Context struct holding the kernel library's logically global state, and passed to external libbitcoin...
Definition:
context.h:16
util::Error
Definition:
result.h:15
translation.h
Untranslated
bilingual_str Untranslated(std::string original)
Mark a bilingual_str as untranslated.
Definition:
translation.h:51
Generated on Wed Dec 18 2024 20:00:10 for Bitcoin Core by
1.9.4