aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoind.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-08-21 20:38:01 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-08-24 07:52:17 +0200
commitfa9d5902f7d72e8cce105dd1b1f5a1062e304b10 (patch)
tree0b5332f79619c87125192fb1b22e0f4bcc6d4de6 /src/bitcoind.cpp
parentfa33bc2dabbbd2d73961f9b0ce51420a3b6e4ad5 (diff)
downloadbitcoin-fa9d5902f7d72e8cce105dd1b1f5a1062e304b10.tar.xz
scripted-diff: gArgs -> args
-BEGIN VERIFY SCRIPT- # Replace gArgs with args sed -i 's/\<gArgs\>/args/g' src/init.cpp src/bitcoind.cpp sed -i 's/&args;/\&gArgs;/g' src/init.cpp # Format changed lines git diff -U0 | clang-format-diff -p1 -i -v -END VERIFY SCRIPT-
Diffstat (limited to 'src/bitcoind.cpp')
-rw-r--r--src/bitcoind.cpp26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp
index 77baa07b8e..227626f40f 100644
--- a/src/bitcoind.cpp
+++ b/src/bitcoind.cpp
@@ -54,22 +54,19 @@ static bool AppInit(int argc, char* argv[])
SetupServerArgs(node);
ArgsManager& args = *Assert(node.args);
std::string error;
- if (!gArgs.ParseParameters(argc, argv, error)) {
+ if (!args.ParseParameters(argc, argv, error)) {
return InitError(Untranslated(strprintf("Error parsing command line arguments: %s\n", error)));
}
// Process help and version before taking care about datadir
- if (HelpRequested(gArgs) || gArgs.IsArgSet("-version")) {
+ if (HelpRequested(args) || args.IsArgSet("-version")) {
std::string strUsage = PACKAGE_NAME " version " + FormatFullVersion() + "\n";
- if (gArgs.IsArgSet("-version"))
- {
+ if (args.IsArgSet("-version")) {
strUsage += FormatParagraph(LicenseInfo()) + "\n";
- }
- else
- {
+ } else {
strUsage += "\nUsage: bitcoind [options] Start " PACKAGE_NAME "\n";
- strUsage += "\n" + gArgs.GetHelpMessage();
+ strUsage += "\n" + args.GetHelpMessage();
}
tfm::format(std::cout, "%s", strUsage);
@@ -80,14 +77,14 @@ static bool AppInit(int argc, char* argv[])
try
{
if (!CheckDataDirOption()) {
- return InitError(Untranslated(strprintf("Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", ""))));
+ return InitError(Untranslated(strprintf("Specified data directory \"%s\" does not exist.\n", args.GetArg("-datadir", ""))));
}
- if (!gArgs.ReadConfigFiles(error, true)) {
+ if (!args.ReadConfigFiles(error, true)) {
return InitError(Untranslated(strprintf("Error reading configuration file: %s\n", error)));
}
// Check for -chain, -testnet or -regtest parameter (Params() calls are only valid after this clause)
try {
- SelectParams(gArgs.GetChainName());
+ SelectParams(args.GetChainName());
} catch (const std::exception& e) {
return InitError(Untranslated(strprintf("%s\n", e.what())));
}
@@ -99,13 +96,13 @@ static bool AppInit(int argc, char* argv[])
}
}
- if (!gArgs.InitSettings(error)) {
+ if (!args.InitSettings(error)) {
InitError(Untranslated(error));
return false;
}
// -server defaults to true for bitcoind but not for the GUI so do this here
- gArgs.SoftSetBoolArg("-server", true);
+ args.SoftSetBoolArg("-server", true);
// Set this early so that parameter interactions go to console
InitLogging(args);
InitParameterInteraction(args);
@@ -122,8 +119,7 @@ static bool AppInit(int argc, char* argv[])
// InitError will have been called with detailed error, which ends up on console
return false;
}
- if (gArgs.GetBoolArg("-daemon", false))
- {
+ if (args.GetBoolArg("-daemon", false)) {
#if HAVE_DECL_DAEMON
#if defined(MAC_OSX)
#pragma GCC diagnostic push