2022-05-27 16:47:05 -04:00
|
|
|
// Copyright (c) 2022 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/checks.h>
|
|
|
|
|
|
|
|
#include <key.h>
|
|
|
|
#include <random.h>
|
|
|
|
#include <util/time.h>
|
|
|
|
|
|
|
|
namespace kernel {
|
|
|
|
|
2022-05-25 18:02:54 -04:00
|
|
|
std::optional<SanityCheckError> SanityChecks(const Context&)
|
|
|
|
{
|
2022-05-27 16:47:05 -04:00
|
|
|
if (!ECC_InitSanityCheck()) {
|
2022-05-25 18:02:54 -04:00
|
|
|
return SanityCheckError::ERROR_ECC;
|
2022-05-27 16:47:05 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!Random_SanityCheck()) {
|
2022-05-25 18:02:54 -04:00
|
|
|
return SanityCheckError::ERROR_RANDOM;
|
2022-05-27 16:47:05 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!ChronoSanityCheck()) {
|
2022-05-25 18:02:54 -04:00
|
|
|
return SanityCheckError::ERROR_CHRONO;
|
2022-05-27 16:47:05 -04:00
|
|
|
}
|
|
|
|
|
2022-05-25 18:02:54 -04:00
|
|
|
return std::nullopt;
|
2022-05-27 16:47:05 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|