diff options
Diffstat (limited to 'src/bitcoind.cpp')
-rw-r--r-- | src/bitcoind.cpp | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 4d010c0d14..b31f86cdd9 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -11,18 +11,22 @@ #include <clientversion.h> #include <compat.h> #include <fs.h> +#include <interfaces/chain.h> #include <rpc/server.h> #include <init.h> #include <noui.h> #include <shutdown.h> -#include <util.h> +#include <util/system.h> #include <httpserver.h> #include <httprpc.h> -#include <utilstrencodings.h> +#include <util/threadnames.h> +#include <util/strencodings.h> #include <walletinitinterface.h> #include <stdio.h> +const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr; + /* Introduction text for doxygen: */ /*! \mainpage Developer documentation @@ -56,8 +60,13 @@ static void WaitForShutdown() // static bool AppInit(int argc, char* argv[]) { + InitInterfaces interfaces; + interfaces.chain = interfaces::MakeChain(); + bool fRet = false; + util::ThreadRename("init"); + // // Parameters // @@ -71,17 +80,15 @@ static bool AppInit(int argc, char* argv[]) // Process help and version before taking care about datadir if (HelpRequested(gArgs) || gArgs.IsArgSet("-version")) { - std::string strUsage = strprintf("%s Daemon", PACKAGE_NAME) + " version " + FormatFullVersion() + "\n"; + std::string strUsage = PACKAGE_NAME " Daemon version " + FormatFullVersion() + "\n"; if (gArgs.IsArgSet("-version")) { - strUsage += FormatParagraph(LicenseInfo()); + strUsage += FormatParagraph(LicenseInfo()) + "\n"; } else { - strUsage += "\nUsage:\n" - " bitcoind [options] " + strprintf("Start %s Daemon", PACKAGE_NAME) + "\n"; - + strUsage += "\nUsage: bitcoind [options] Start " PACKAGE_NAME " Daemon\n"; strUsage += "\n" + gArgs.GetHelpMessage(); } @@ -164,7 +171,7 @@ static bool AppInit(int argc, char* argv[]) // If locking the data directory failed, exit immediately return false; } - fRet = AppInitMain(); + fRet = AppInitMain(interfaces); } catch (const std::exception& e) { PrintExceptionContinue(&e, "AppInit()"); @@ -178,13 +185,17 @@ static bool AppInit(int argc, char* argv[]) } else { WaitForShutdown(); } - Shutdown(); + Shutdown(interfaces); return fRet; } int main(int argc, char* argv[]) { +#ifdef WIN32 + util::WinCmdLineArgs winArgs; + std::tie(argc, argv) = winArgs.get(); +#endif SetupEnvironment(); // Connect bitcoind signal handlers |