diff options
Diffstat (limited to 'src/bitcoind.cpp')
| -rw-r--r-- | src/bitcoind.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 5d8721884..9b535c2e6 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -70,7 +70,13 @@ bool AppInit(int argc, char* argv[]) fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str()); return false; } - ReadConfigFile(mapArgs, mapMultiArgs); + try + { + ReadConfigFile(mapArgs, mapMultiArgs); + } catch(std::exception &e) { + fprintf(stderr,"Error reading configuration file: %s\n", e.what()); + return false; + } // Check for -testnet or -regtest parameter (TestNet() calls are only valid after this clause) if (!SelectParamsFromCommandLine()) { fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n"); @@ -82,9 +88,9 @@ bool AppInit(int argc, char* argv[]) // First part of help message is specific to bitcoind / RPC client std::string strUsage = _("Bitcoin Core Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n\n" + _("Usage:") + "\n" + - " bitcoind [options] " + _("Start Bitcoin server") + "\n" + + " bitcoind [options] " + _("Start Bitcoin Core Daemon") + "\n" + _("Usage (deprecated, use bitcoin-cli):") + "\n" + - " bitcoind [options] <command> [params] " + _("Send command to Bitcoin server") + "\n" + + " bitcoind [options] <command> [params] " + _("Send command to Bitcoin Core") + "\n" + " bitcoind [options] help " + _("List commands") + "\n" + " bitcoind [options] help <command> " + _("Get help for a command") + "\n"; @@ -166,15 +172,10 @@ bool AppInit(int argc, char* argv[]) int main(int argc, char* argv[]) { - bool fRet = false; + SetupEnvironment(); // Connect bitcoind signal handlers noui_connect(); - fRet = AppInit(argc, argv); - - if (fRet && fDaemon) - return 0; - - return (fRet ? 0 : 1); + return (AppInit(argc, argv) ? 0 : 1); } |