File tree Expand file tree Collapse file tree 3 files changed +31
-26
lines changed Expand file tree Collapse file tree 3 files changed +31
-26
lines changed Original file line number Diff line number Diff line change @@ -672,30 +672,6 @@ static void StartupNotify(const ArgsManager& args)
672
672
}
673
673
#endif
674
674
675
- /* * Sanity checks
676
- * Ensure that Bitcoin is running in a usable environment with all
677
- * necessary library support.
678
- */
679
- static bool InitSanityCheck ()
680
- {
681
- if (!ECC_InitSanityCheck ()) {
682
- return InitError (Untranslated (" Elliptic curve cryptography sanity check failure. Aborting." ));
683
- }
684
-
685
- if (!glibcxx_sanity_test ())
686
- return false ;
687
-
688
- if (!Random_SanityCheck ()) {
689
- return InitError (Untranslated (" OS cryptographic RNG sanity check failure. Aborting." ));
690
- }
691
-
692
- if (!ChronoSanityCheck ()) {
693
- return InitError (Untranslated (" Clock epoch mismatch. Aborting." ));
694
- }
695
-
696
- return true ;
697
- }
698
-
699
675
static bool AppInitServers (NodeContext& node)
700
676
{
701
677
const ArgsManager& args = *Assert (node.args );
@@ -1147,9 +1123,9 @@ bool AppInitSanityChecks()
1147
1123
1148
1124
init::SetGlobals ();
1149
1125
1150
- // Sanity check
1151
- if (!InitSanityCheck ())
1126
+ if (!init::SanityChecks ()) {
1152
1127
return InitError (strprintf (_ (" Initialization sanity check failed. %s is shutting down." ), PACKAGE_NAME));
1128
+ }
1153
1129
1154
1130
// Probe the data directory lock to give an early error message, if possible
1155
1131
// We cannot hold the data directory lock here, as the forking for daemon() hasn't yet happened,
Original file line number Diff line number Diff line change 2
2
// Distributed under the MIT software license, see the accompanying
3
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
4
5
+ #include < compat/sanity.h>
5
6
#include < crypto/sha256.h>
6
7
#include < key.h>
7
8
#include < logging.h>
9
+ #include < node/ui_interface.h>
8
10
#include < pubkey.h>
9
11
#include < random.h>
12
+ #include < util/time.h>
13
+ #include < util/translation.h>
10
14
11
15
#include < memory>
12
16
@@ -27,4 +31,24 @@ void UnsetGlobals()
27
31
globalVerifyHandle.reset ();
28
32
ECC_Stop ();
29
33
}
34
+
35
+ bool SanityChecks ()
36
+ {
37
+ if (!ECC_InitSanityCheck ()) {
38
+ return InitError (Untranslated (" Elliptic curve cryptography sanity check failure. Aborting." ));
39
+ }
40
+
41
+ if (!glibcxx_sanity_test ())
42
+ return false ;
43
+
44
+ if (!Random_SanityCheck ()) {
45
+ return InitError (Untranslated (" OS cryptographic RNG sanity check failure. Aborting." ));
46
+ }
47
+
48
+ if (!ChronoSanityCheck ()) {
49
+ return InitError (Untranslated (" Clock epoch mismatch. Aborting." ));
50
+ }
51
+
52
+ return true ;
53
+ }
30
54
} // namespace init
Original file line number Diff line number Diff line change 11
11
namespace init {
12
12
void SetGlobals ();
13
13
void UnsetGlobals ();
14
+ /* *
15
+ * Ensure a usable environment with all
16
+ * necessary library support.
17
+ */
18
+ bool SanityChecks ();
14
19
} // namespace init
15
20
16
21
#endif // BITCOIN_INIT_COMMON_H
You can’t perform that action at this time.
0 commit comments