MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / AppInitBasicSetup

Function AppInitBasicSetup

src/init.cpp:908–943  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

906};
907
908bool AppInitBasicSetup(const ArgsManager& args, std::atomic<int>& exit_status)
909{
910 // ********************************************************* Step 1: setup
911#ifdef _MSC_VER
912 // Turn off Microsoft heap dump noise
913 _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
914 _CrtSetReportFile(_CRT_WARN, CreateFileA("NUL", GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, 0));
915 // Disable confusing "helpful" text message on abort, Ctrl-C
916 _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
917#endif
918#ifdef WIN32
919 // Enable heap terminate-on-corruption
920 HeapSetInformation(nullptr, HeapEnableTerminationOnCorruption, nullptr, 0);
921#endif
922 if (!SetupNetworking()) {
923 return InitError(Untranslated("Initializing networking failed."));
924 }
925
926#ifndef WIN32
927 // Clean shutdown on SIGTERM
928 registerSignalHandler(SIGTERM, HandleSIGTERM);
929 registerSignalHandler(SIGINT, HandleSIGTERM);
930
931 // Reopen debug.log on SIGHUP
932 registerSignalHandler(SIGHUP, HandleSIGHUP);
933
934 // Ignore SIGPIPE, otherwise it will bring the daemon down if the client closes unexpectedly
935 signal(SIGPIPE, SIG_IGN);
936#else
937 SetConsoleCtrlHandler(consoleCtrlHandler, true);
938#endif
939
940 std::set_new_handler(new_handler_terminate);
941
942 return true;
943}
944
945bool AppInitParameterInteraction(const ArgsManager& args)
946{

Callers 2

AppInitFunction · 0.85
baseInitializeMethod · 0.85

Calls 5

SetupNetworkingFunction · 0.85
InitErrorFunction · 0.85
UntranslatedFunction · 0.85
registerSignalHandlerFunction · 0.85
signalClass · 0.85

Tested by

no test coverage detected