MCPcopy Create free account
hub / github.com/Bitcoin-ABC/bitcoin-abc / AppInitBasicSetup

Function AppInitBasicSetup

src/init.cpp:1795–1835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1793};
1794
1795bool AppInitBasicSetup(const ArgsManager &args, std::atomic<int> &exit_status) {
1796// Step 1: setup
1797#ifdef _MSC_VER
1798 // Turn off Microsoft heap dump noise
1799 _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
1800 _CrtSetReportFile(_CRT_WARN, CreateFileA("NUL", GENERIC_WRITE, 0, nullptr,
1801 OPEN_EXISTING, 0, 0));
1802 // Disable confusing "helpful" text message on abort, Ctrl-C
1803 _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
1804#endif
1805#ifdef WIN32
1806 // Enable Data Execution Prevention (DEP)
1807 SetProcessDEPPolicy(PROCESS_DEP_ENABLE);
1808#endif
1809 if (!SetupNetworking()) {
1810 return InitError(Untranslated("Initializing networking failed"));
1811 }
1812
1813#ifndef WIN32
1814 if (!args.GetBoolArg("-sysperms", false)) {
1815 umask(077);
1816 }
1817
1818 // Clean shutdown on SIGTERM
1819 registerSignalHandler(SIGTERM, HandleSIGTERM);
1820 registerSignalHandler(SIGINT, HandleSIGTERM);
1821
1822 // Reopen debug.log on SIGHUP
1823 registerSignalHandler(SIGHUP, HandleSIGHUP);
1824
1825 // Ignore SIGPIPE, otherwise it will bring the daemon down if the client
1826 // closes unexpectedly
1827 signal(SIGPIPE, SIG_IGN);
1828#else
1829 SetConsoleCtrlHandler(consoleCtrlHandler, true);
1830#endif
1831
1832 std::set_new_handler(new_handler_terminate);
1833
1834 return true;
1835}
1836
1837bool AppInitParameterInteraction(Config &config, const ArgsManager &args) {
1838 const CChainParams &chainparams = config.GetChainParams();

Callers 2

AppInitFunction · 0.85
baseInitializeMethod · 0.85

Calls 5

SetupNetworkingFunction · 0.85
InitErrorFunction · 0.85
UntranslatedFunction · 0.85
registerSignalHandlerFunction · 0.85
GetBoolArgMethod · 0.80

Tested by

no test coverage detected