diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2021-04-18 18:58:43 -0400 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2021-04-19 06:11:38 -0400 |
commit | 387c4cf5887bfdaf1606e1b287d901e4c449514f (patch) | |
tree | 1d3c9deafd400edec87f8db0bed3a8bf5dacfd1e /src/init.cpp | |
parent | a67b54855b294802d52f09fa60d3f63550cbada7 (diff) |
Move common sanity check code to init/common
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/src/init.cpp b/src/init.cpp index 4298494916..05466248b1 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -672,30 +672,6 @@ static void StartupNotify(const ArgsManager& args) } #endif -/** Sanity checks - * Ensure that Bitcoin is running in a usable environment with all - * necessary library support. - */ -static bool InitSanityCheck() -{ - if (!ECC_InitSanityCheck()) { - return InitError(Untranslated("Elliptic curve cryptography sanity check failure. Aborting.")); - } - - if (!glibcxx_sanity_test()) - return false; - - if (!Random_SanityCheck()) { - return InitError(Untranslated("OS cryptographic RNG sanity check failure. Aborting.")); - } - - if (!ChronoSanityCheck()) { - return InitError(Untranslated("Clock epoch mismatch. Aborting.")); - } - - return true; -} - static bool AppInitServers(NodeContext& node) { const ArgsManager& args = *Assert(node.args); @@ -1147,9 +1123,9 @@ bool AppInitSanityChecks() init::SetGlobals(); - // Sanity check - if (!InitSanityCheck()) + if (!init::SanityChecks()) { return InitError(strprintf(_("Initialization sanity check failed. %s is shutting down."), PACKAGE_NAME)); + } // Probe the data directory lock to give an early error message, if possible // We cannot hold the data directory lock here, as the forking for daemon() hasn't yet happened, |