aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-06-11 08:26:55 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-06-11 08:34:25 +0200
commitd01574f792779667a554f26d3379935827813c19 (patch)
tree462b55f018f5637c0c7e384020fab418c4d036e7 /src/init.cpp
parent4e45932659aa04417661b63e7e0546e656997d6c (diff)
parent4a09e1df51267c6d2dec219c6f96a24b716cc251 (diff)
Merge pull request #4277
4a09e1d key.cpp: fail with a friendlier message on missing ssl EC support (Andrew Poelstra)
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp
index ca348b614e..1d86cf087d 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -11,6 +11,7 @@
#include "addrman.h"
#include "checkpoints.h"
+#include "key.h"
#include "main.h"
#include "miner.h"
#include "net.h"
@@ -394,6 +395,23 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
}
}
+/** Sanity checks
+ * Ensure that Bitcoin is running in a usable environment with all
+ * necessary library support.
+ */
+bool InitSanityCheck(void)
+{
+ if(!ECC_InitSanityCheck()) {
+ InitError("OpenSSL appears to lack support for elliptic curve cryptography. For more "
+ "information, visit https://en.bitcoin.it/wiki/OpenSSL_and_EC_Libraries");
+ return false;
+ }
+
+ // TODO: remaining sanity checks, see #4081
+
+ return true;
+}
+
/** Initialize bitcoin.
* @pre Parameters should be parsed and config file should be read.
*/
@@ -598,6 +616,9 @@ bool AppInit2(boost::thread_group& threadGroup)
std::string strWalletFile = GetArg("-wallet", "wallet.dat");
#endif
// ********************************************************* Step 4: application initialization: dir lock, daemonize, pidfile, debug log
+ // Sanity check
+ if (!InitSanityCheck())
+ return InitError(_("Initialization sanity check failed. Bitcoin Core is shutting down."));
std::string strDataDir = GetDataDir().string();
#ifdef ENABLE_WALLET