mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
refactor: Replace std::optional<bilingual_str> with util::Result
This commit is contained in:
@@ -13,21 +13,21 @@
|
||||
|
||||
namespace kernel {
|
||||
|
||||
std::optional<bilingual_str> SanityChecks(const Context&)
|
||||
util::Result<void> SanityChecks(const Context&)
|
||||
{
|
||||
if (!ECC_InitSanityCheck()) {
|
||||
return Untranslated("Elliptic curve cryptography sanity check failure. Aborting.");
|
||||
return util::Error{Untranslated("Elliptic curve cryptography sanity check failure. Aborting.")};
|
||||
}
|
||||
|
||||
if (!Random_SanityCheck()) {
|
||||
return Untranslated("OS cryptographic RNG sanity check failure. Aborting.");
|
||||
return util::Error{Untranslated("OS cryptographic RNG sanity check failure. Aborting.")};
|
||||
}
|
||||
|
||||
if (!ChronoSanityCheck()) {
|
||||
return Untranslated("Clock epoch mismatch. Aborting.");
|
||||
return util::Error{Untranslated("Clock epoch mismatch. Aborting.")};
|
||||
}
|
||||
|
||||
return std::nullopt;
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user