diff options
Diffstat (limited to 'src/bitcoind.cpp')
-rw-r--r-- | src/bitcoind.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index bf04d95b50..b31f86cdd9 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -11,14 +11,16 @@ #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> @@ -58,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 // @@ -77,7 +84,7 @@ static bool AppInit(int argc, char* argv[]) if (gArgs.IsArgSet("-version")) { - strUsage += FormatParagraph(LicenseInfo()); + strUsage += FormatParagraph(LicenseInfo()) + "\n"; } else { @@ -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 |