From 9dd793f499254600efa468938cef9baa28ac81b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Tim=C3=B3n?= Date: Sun, 5 Jul 2015 14:17:46 +0200 Subject: TRIVIAL: Missing includes --- src/bitcoind.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index cce687ac9..cfa32d981 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -3,6 +3,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include "chainparams.h" #include "clientversion.h" #include "rpcserver.h" #include "init.h" -- cgit v1.2.3 From 60c8bac77c6612b84e3496b2227a01058d720ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Tim=C3=B3n?= Date: Sun, 5 Jul 2015 14:30:07 +0200 Subject: Includes: Cleanup around net main and wallet -Move from .h to .cpp: in main, net and wallet -Remove unnecessary #include "main.h" -Cleanup some wallet files includes --- src/bitcoind.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index cfa32d981..39bb301f4 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -7,7 +7,6 @@ #include "clientversion.h" #include "rpcserver.h" #include "init.h" -#include "main.h" #include "noui.h" #include "scheduler.h" #include "util.h" -- cgit v1.2.3 From 40b556d3742a1f65d67e2d4c760d0b13fe8be5b7 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 23 Jan 2015 07:53:17 +0100 Subject: evhttpd implementation - *Replace usage of boost::asio with [libevent2](http://libevent.org/)*. boost::asio is not part of C++11, so unlike other boost there is no forwards-compatibility reason to stick with it. Together with #4738 (convert json_spirit to UniValue), this rids Bitcoin Core of the worst offenders with regard to compile-time slowness. - *Replace spit-and-duct-tape http server with evhttp*. Front-end http handling is handled by libevent, a work queue (with configurable depth and parallelism) is used to handle application requests. - *Wrap HTTP request in C++ class*; this makes the application code mostly HTTP-server-neutral - *Refactor RPC to move all http-specific code to a separate file*. Theoreticaly this can allow building without HTTP server but with another RPC backend, e.g. Qt's debug console (currently not implemented) or future RPC mechanisms people may want to use. - *HTTP dispatch mechanism*; services (e.g., RPC, REST) register which URL paths they want to handle. By using a proven, high-performance asynchronous networking library (also used by Tor) and HTTP server, problems such as #5674, #5655, #344 should be avoided. What works? bitcoind, bitcoin-cli, bitcoin-qt. Unit tests and RPC/REST tests pass. The aim for now is everything but SSL support. Configuration options: - `-rpcthreads`: repurposed as "number of work handler threads". Still defaults to 4. - `-rpcworkqueue`: maximum depth of work queue. When this is reached, new requests will return a 500 Internal Error. - `-rpctimeout`: inactivity time, in seconds, after which to disconnect a client. - `-debug=http`: low-level http activity logging --- src/bitcoind.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 39bb301f4..b512f74c2 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -10,11 +10,16 @@ #include "noui.h" #include "scheduler.h" #include "util.h" +#include "httpserver.h" +#include "httprpc.h" +#include "rpcserver.h" #include #include #include +#include + /* Introduction text for doxygen: */ /*! \mainpage Developer documentation @@ -44,7 +49,7 @@ void WaitForShutdown(boost::thread_group* threadGroup) } if (threadGroup) { - threadGroup->interrupt_all(); + Interrupt(*threadGroup); threadGroup->join_all(); } } @@ -154,7 +159,7 @@ bool AppInit(int argc, char* argv[]) if (!fRet) { - threadGroup.interrupt_all(); + Interrupt(threadGroup); // threadGroup.join_all(); was left out intentionally here, because we didn't re-test all of // the startup-failure cases to make sure they don't result in a hang due to some // thread-blocking-waiting-for-another-thread-during-startup case -- cgit v1.2.3 From 55a89751faaada5598771d10401030e9e86eecbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Tim=C3=B3n?= Date: Mon, 25 May 2015 09:00:17 +0200 Subject: Chainparams: Translations: DRY: options and error strings Also remove SelectBaseParamsFromCommandLine and SelectParamsFromCommandLine --- src/bitcoind.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 39bb301f4..d8fa47347 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -102,8 +102,10 @@ bool AppInit(int argc, char* argv[]) return false; } // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) - if (!SelectParamsFromCommandLine()) { - fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n"); + try { + SelectParams(ChainNameFromCommandLine()); + } catch(std::exception &e) { + fprintf(stderr, "Error: %s\n", e.what()); return false; } -- cgit v1.2.3 From 3cb56f37780854bf26650e0872a556da25897a0a Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Sun, 18 Oct 2015 21:02:36 +1100 Subject: *: alias -h for --help --- src/bitcoind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index b512f74c2..ca05fefb7 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -72,7 +72,7 @@ bool AppInit(int argc, char* argv[]) ParseParameters(argc, argv); // Process help and version before taking care about datadir - if (mapArgs.count("-?") || mapArgs.count("-help") || mapArgs.count("-version")) + if (mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help") || mapArgs.count("-version")) { std::string strUsage = _("Bitcoin Core Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n"; -- cgit v1.2.3 From ad5aae15b40dcbdbfc08221e615f06b030b92334 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Tue, 27 Oct 2015 17:39:42 +0100 Subject: constify missing catch cases - ensure all missing catch cases are constant where possible --- src/bitcoind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index d2af89724..addf0e6a2 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -109,7 +109,7 @@ bool AppInit(int argc, char* argv[]) // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) try { SelectParams(ChainNameFromCommandLine()); - } catch(std::exception &e) { + } catch (const std::exception& e) { fprintf(stderr, "Error: %s\n", e.what()); return false; } -- cgit v1.2.3 From 411b05ac9511395923976bfbd0c153ddabf2ebcf Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Thu, 8 Oct 2015 09:58:31 +0200 Subject: Refactor parameter interaction, call it before AppInit2() --- src/bitcoind.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index addf0e6a2..f1875731d 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -151,6 +151,7 @@ bool AppInit(int argc, char* argv[]) #endif SoftSetBoolArg("-server", true); + InitParameterInteraction(); fRet = AppInit2(threadGroup, scheduler); } catch (const std::exception& e) { -- cgit v1.2.3 From a46f87f0c17323d8853d95f8ea99f8fb0f3bda1a Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Thu, 26 Nov 2015 14:03:27 +0100 Subject: Initialize logging before we do parameter interaction --- src/bitcoind.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index f1875731d..4cee2d3cf 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -151,6 +151,8 @@ bool AppInit(int argc, char* argv[]) #endif SoftSetBoolArg("-server", true); + // Set this early so that parameter interactions go to console + InitLogging(); InitParameterInteraction(); fRet = AppInit2(threadGroup, scheduler); } -- cgit v1.2.3 From fa24439ff3d8ab5b9efaf66ef4dae6713b88cb35 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Sun, 13 Dec 2015 17:58:29 +0100 Subject: Bump copyright headers to 2015 --- src/bitcoind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 4cee2d3cf..3b6608c95 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -- cgit v1.2.3 From d5f46832de900cee0801ca40bba743c9564cccb8 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 9 Dec 2015 10:53:12 +0000 Subject: Unify package name to as few places as possible without major changes --- src/bitcoind.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index addf0e6a2..440356aa8 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -3,6 +3,10 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#if defined(HAVE_CONFIG_H) +#include "config/bitcoin-config.h" +#endif + #include "chainparams.h" #include "clientversion.h" #include "rpcserver.h" @@ -74,7 +78,7 @@ bool AppInit(int argc, char* argv[]) // Process help and version before taking care about datadir if (mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help") || mapArgs.count("-version")) { - std::string strUsage = _("Bitcoin Core Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n"; + std::string strUsage = strprintf(_("%s Daemon"), _(PACKAGE_NAME)) + " " + _("version") + " " + FormatFullVersion() + "\n"; if (mapArgs.count("-version")) { @@ -83,7 +87,7 @@ bool AppInit(int argc, char* argv[]) else { strUsage += "\n" + _("Usage:") + "\n" + - " bitcoind [options] " + _("Start Bitcoin Core Daemon") + "\n"; + " bitcoind [options] " + strprintf(_("Start %s Daemon"), _(PACKAGE_NAME)) + "\n"; strUsage += "\n" + HelpMessage(HMM_BITCOIND); } -- cgit v1.2.3 From a0eaff8a1d18ebba33cdea4cd1efaddeb55519e7 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Fri, 15 Jan 2016 11:55:17 +1100 Subject: move rpc* to rpc/ --- src/bitcoind.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 3b6608c95..d1fd56d17 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -5,14 +5,13 @@ #include "chainparams.h" #include "clientversion.h" -#include "rpcserver.h" +#include "rpc/server.h" #include "init.h" #include "noui.h" #include "scheduler.h" #include "util.h" #include "httpserver.h" #include "httprpc.h" -#include "rpcserver.h" #include #include -- cgit v1.2.3 From 027fdb83b41ae9e9125cf61f6460c03ab34e5961 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 3 Feb 2016 05:38:27 +0000 Subject: When/if the copyright line does not mention Bitcoin Core developers, add a second line to copyrights in -version, About dialog, and splash screen --- src/bitcoind.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 440356aa8..9ad5a4786 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -17,6 +17,7 @@ #include "httpserver.h" #include "httprpc.h" #include "rpcserver.h" +#include "utilstrencodings.h" #include #include @@ -82,7 +83,7 @@ bool AppInit(int argc, char* argv[]) if (mapArgs.count("-version")) { - strUsage += LicenseInfo(); + strUsage += FormatParagraph(LicenseInfo()); } else { -- cgit v1.2.3 From ff2ed7a5bc8f56d2c0cd8d4fa6cf06ecfe17f1b2 Mon Sep 17 00:00:00 2001 From: mruddy Date: Sun, 4 Sep 2016 11:42:07 -0400 Subject: trivial: remove unnecessary variable fDaemon --- src/bitcoind.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 28bc374ac..322298d1b 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -40,8 +40,6 @@ * Use the buttons Namespaces, Classes or Files at the top of the page to start navigating the code. */ -static bool fDaemon; - void WaitForShutdown(boost::thread_group* threadGroup) { bool fShutdown = ShutdownRequested(); @@ -130,8 +128,7 @@ bool AppInit(int argc, char* argv[]) exit(1); } #ifndef WIN32 - fDaemon = GetBoolArg("-daemon", false); - if (fDaemon) + if (GetBoolArg("-daemon", false)) { fprintf(stdout, "Bitcoin server starting\n"); -- cgit v1.2.3 From a92bf4af66f8b5a2e6bc28baa6670065ce76daf2 Mon Sep 17 00:00:00 2001 From: Matthew King Date: Tue, 28 Jun 2016 09:35:41 +0300 Subject: bitcoind: Daemonize using daemon(3) Simplified version of #8278. Assumes that every OS that (a) is supported by Bitcoin Core (b) supports daemonization has the `daemon()` function in its C library. - Removes the fallback path for operating systems that support daemonization but not `daemon()`. This prevents never-exercised code from ending up in the repository (see discussion here: https://github.com/bitcoin/bitcoin/pull/8278#issuecomment-242704745). - Removes the windows-specific path. Windows doesn't support `daemon()`, so it don't support daemonization there, automatically. Original code by Matthew King, adapted by Wladimir van der Laan. --- src/bitcoind.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 322298d1b..25d720e1e 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -9,6 +9,7 @@ #include "chainparams.h" #include "clientversion.h" +#include "compat.h" #include "rpc/server.h" #include "init.h" #include "noui.h" @@ -127,29 +128,21 @@ bool AppInit(int argc, char* argv[]) fprintf(stderr, "Error: There is no RPC client functionality in bitcoind anymore. Use the bitcoin-cli utility instead.\n"); exit(1); } -#ifndef WIN32 if (GetBoolArg("-daemon", false)) { +#if HAVE_DECL_DAEMON fprintf(stdout, "Bitcoin server starting\n"); // Daemonize - pid_t pid = fork(); - if (pid < 0) - { - fprintf(stderr, "Error: fork() returned %d errno %d\n", pid, errno); + if (daemon(1, 0)) { // don't chdir (1), do close FDs (0) + fprintf(stderr, "Error: daemon() failed: %s\n", strerror(errno)); return false; } - if (pid > 0) // Parent process, pid is child process id - { - return true; - } - // Child process falls through to rest of initialization - - pid_t sid = setsid(); - if (sid < 0) - fprintf(stderr, "Error: setsid() returned %d errno %d\n", sid, errno); +#else + fprintf(stderr, "Error: -daemon is not supported on this operating system\n"); + return false; +#endif // HAVE_DECL_DAEMON } -#endif SoftSetBoolArg("-server", true); // Set this early so that parameter interactions go to console -- cgit v1.2.3 From 3450c18a125f125aec76bfef79c69317eaad935d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Tim=C3=B3n?= Date: Wed, 28 Sep 2016 10:10:15 +0200 Subject: Globals: Decouple GetConfigFile and ReadConfigFile from global mapArgs --- src/bitcoind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 25d720e1e..351463c25 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -104,7 +104,7 @@ bool AppInit(int argc, char* argv[]) } try { - ReadConfigFile(mapArgs, mapMultiArgs); + ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME), mapArgs, mapMultiArgs); } catch (const std::exception& e) { fprintf(stderr,"Error reading configuration file: %s\n", e.what()); return false; -- cgit v1.2.3 From bd0de1386e1c7f9b875d52290de0d561c8d56bc9 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Wed, 2 Nov 2016 21:59:09 +0300 Subject: Fix exit codes: - `--help`, `--version` etc should exit with `0` i.e. no error ("not enough args" case should still trigger an error) - error reading config file should exit with `1` Slightly refactor AppInitRPC/AppInitRawTx to return standard exit codes (EXIT_FAILURE/EXIT_SUCCESS) or CONTINUE_EXECUTION (-1) --- src/bitcoind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 351463c25..a0d039359 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -92,7 +92,7 @@ bool AppInit(int argc, char* argv[]) } fprintf(stdout, "%s", strUsage.c_str()); - return false; + return true; } try -- cgit v1.2.3 From 4441018d0860fce64ee74fa78da79bbb21114ca9 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Mon, 7 Nov 2016 21:31:38 +0300 Subject: Every main()/exit() should return/use one of EXIT_ codes instead of magic numbers --- src/bitcoind.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index a0d039359..3352a76de 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -126,7 +126,7 @@ bool AppInit(int argc, char* argv[]) if (fCommandLine) { fprintf(stderr, "Error: There is no RPC client functionality in bitcoind anymore. Use the bitcoin-cli utility instead.\n"); - exit(1); + exit(EXIT_FAILURE); } if (GetBoolArg("-daemon", false)) { @@ -177,5 +177,5 @@ int main(int argc, char* argv[]) // Connect bitcoind signal handlers noui_connect(); - return (AppInit(argc, argv) ? 0 : 1); + return (AppInit(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE); } -- cgit v1.2.3 From 0cc8b6bc44bea29e24fa4e13d8a9bbe4f1483680 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 25 Oct 2016 11:34:27 +0200 Subject: init: Split up AppInit2 into multiple phases This allows doing some of the steps before e.g. daemonization and some fater. --- src/bitcoind.cpp | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 351463c25..a89b8cd4e 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -128,6 +128,26 @@ bool AppInit(int argc, char* argv[]) fprintf(stderr, "Error: There is no RPC client functionality in bitcoind anymore. Use the bitcoin-cli utility instead.\n"); exit(1); } + // -server defaults to true for bitcoind but not for the GUI so do this here + SoftSetBoolArg("-server", true); + // Set this early so that parameter interactions go to console + InitLogging(); + InitParameterInteraction(); + if (!AppInitBasicSetup()) + { + // InitError will have been called with detailed error, which ends up on console + exit(1); + } + if (!AppInitParameterInteraction()) + { + // InitError will have been called with detailed error, which ends up on console + exit(1); + } + if (!AppInitSanityChecks()) + { + // InitError will have been called with detailed error, which ends up on console + exit(1); + } if (GetBoolArg("-daemon", false)) { #if HAVE_DECL_DAEMON @@ -143,12 +163,8 @@ bool AppInit(int argc, char* argv[]) return false; #endif // HAVE_DECL_DAEMON } - SoftSetBoolArg("-server", true); - // Set this early so that parameter interactions go to console - InitLogging(); - InitParameterInteraction(); - fRet = AppInit2(threadGroup, scheduler); + fRet = AppInitMain(threadGroup, scheduler); } catch (const std::exception& e) { PrintExceptionContinue(&e, "AppInit()"); -- cgit v1.2.3 From c8042a48f01aaf306e108683e40db4bfaf0bbcaa Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 29 Nov 2016 15:17:34 -0800 Subject: Remove arguments to ParseConfigFile --- src/bitcoind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index ba3ccac61..3dd085628 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -104,7 +104,7 @@ bool AppInit(int argc, char* argv[]) } try { - ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME), mapArgs, mapMultiArgs); + ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME)); } catch (const std::exception& e) { fprintf(stderr,"Error reading configuration file: %s\n", e.what()); return false; -- cgit v1.2.3 From 0cf86a6678413aa03e765a7133f048df4001ff4c Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 29 Nov 2016 17:51:30 -0800 Subject: Introduce (and use) an IsArgSet accessor method --- src/bitcoind.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 3dd085628..ee27f4122 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -75,11 +75,11 @@ bool AppInit(int argc, char* argv[]) ParseParameters(argc, argv); // Process help and version before taking care about datadir - if (mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help") || mapArgs.count("-version")) + if (IsArgSet("-?") || IsArgSet("-h") || IsArgSet("-help") || IsArgSet("-version")) { std::string strUsage = strprintf(_("%s Daemon"), _(PACKAGE_NAME)) + " " + _("version") + " " + FormatFullVersion() + "\n"; - if (mapArgs.count("-version")) + if (IsArgSet("-version")) { strUsage += FormatParagraph(LicenseInfo()); } -- cgit v1.2.3 From 4cd373aea8d20356727f7d65e0bc818beb6523dc Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 29 Nov 2016 18:45:24 -0800 Subject: Un-expose mapArgs from utils.h --- src/bitcoind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index ee27f4122..98551ee85 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -99,7 +99,7 @@ bool AppInit(int argc, char* argv[]) { if (!boost::filesystem::is_directory(GetDataDir(false))) { - fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str()); + fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", GetArg("-datadir", "").c_str()); return false; } try -- cgit v1.2.3 From 27765b6403cece54320374b37afb01a0cfe571c3 Mon Sep 17 00:00:00 2001 From: isle2983 Date: Sat, 31 Dec 2016 11:01:21 -0700 Subject: Increment MIT Licence copyright header year on files modified in 2016 Edited via: $ contrib/devtools/copyright_header.py update . --- src/bitcoind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 98551ee85..9bab3a202 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2015 The Bitcoin Core developers +// Copyright (c) 2009-2016 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -- cgit v1.2.3 From 148a2aca05fe98031bcf857fa186d792c507090c Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Mon, 27 Jul 2015 16:35:30 +0100 Subject: Introduce basic Dogecoin branding --- src/bitcoind.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/bitcoind.cpp') diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 9bab3a202..8d50d4aff 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -86,7 +86,7 @@ bool AppInit(int argc, char* argv[]) else { strUsage += "\n" + _("Usage:") + "\n" + - " bitcoind [options] " + strprintf(_("Start %s Daemon"), _(PACKAGE_NAME)) + "\n"; + " dogecoind [options] " + strprintf(_("Start %s Daemon"), _(PACKAGE_NAME)) + "\n"; strUsage += "\n" + HelpMessage(HMM_BITCOIND); } @@ -120,12 +120,12 @@ bool AppInit(int argc, char* argv[]) // Command-line RPC bool fCommandLine = false; for (int i = 1; i < argc; i++) - if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], "bitcoin:")) + if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], "dogecoin:")) fCommandLine = true; if (fCommandLine) { - fprintf(stderr, "Error: There is no RPC client functionality in bitcoind anymore. Use the bitcoin-cli utility instead.\n"); + fprintf(stderr, "Error: There is no RPC client functionality in dogecoind anymore. Use the dogecoin-cli utility instead.\n"); exit(EXIT_FAILURE); } // -server defaults to true for bitcoind but not for the GUI so do this here @@ -151,7 +151,7 @@ bool AppInit(int argc, char* argv[]) if (GetBoolArg("-daemon", false)) { #if HAVE_DECL_DAEMON - fprintf(stdout, "Bitcoin server starting\n"); + fprintf(stdout, "Dogecoin server starting\n"); // Daemonize if (daemon(1, 0)) { // don't chdir (1), do close FDs (0) -- cgit v1.2.3