mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Merge remote-tracking branch 'bitcoin-gh/0.18' into 0.18.0-backports
This commit is contained in:
commit
a7742ca3a2
199 changed files with 9325 additions and 5920 deletions
16
src/init.cpp
16
src/init.cpp
|
|
@ -103,7 +103,6 @@ static const char* FEE_ESTIMATES_FILENAME="fee_estimates.dat";
|
|||
/**
|
||||
* The PID file facilities.
|
||||
*/
|
||||
#ifndef WIN32
|
||||
static const char* BITCOIN_PID_FILENAME = "bitcoind.pid";
|
||||
|
||||
static fs::path GetPidFile()
|
||||
|
|
@ -115,14 +114,17 @@ NODISCARD static bool CreatePidFile()
|
|||
{
|
||||
FILE* file = fsbridge::fopen(GetPidFile(), "w");
|
||||
if (file) {
|
||||
#ifdef WIN32
|
||||
fprintf(file, "%d\n", GetCurrentProcessId());
|
||||
#else
|
||||
fprintf(file, "%d\n", getpid());
|
||||
#endif
|
||||
fclose(file);
|
||||
return true;
|
||||
} else {
|
||||
return InitError(strprintf(_("Unable to create the PID file '%s': %s"), GetPidFile().string(), std::strerror(errno)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
|
@ -293,15 +295,13 @@ void Shutdown(InitInterfaces& interfaces)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef WIN32
|
||||
try {
|
||||
if (!fs::remove(GetPidFile())) {
|
||||
LogPrintf("%s: Unable to remove PID file: File does not exist\n", __func__);
|
||||
}
|
||||
} catch (const fs::filesystem_error& e) {
|
||||
LogPrintf("%s: Unable to remove PID file: %s\n", __func__, e.what());
|
||||
LogPrintf("%s: Unable to remove PID file: %s\n", __func__, fsbridge::get_filesystem_error_message(e));
|
||||
}
|
||||
#endif
|
||||
interfaces.chain_clients.clear();
|
||||
UnregisterAllValidationInterfaces();
|
||||
GetMainSignals().UnregisterBackgroundSignalScheduler();
|
||||
|
|
@ -399,11 +399,7 @@ void SetupServerArgs()
|
|||
gArgs.AddArg("-par=<n>", strprintf("Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)",
|
||||
-GetNumCores(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS), false, OptionsCategory::OPTIONS);
|
||||
gArgs.AddArg("-persistmempool", strprintf("Whether to save the mempool on shutdown and load on restart (default: %u)", DEFAULT_PERSIST_MEMPOOL), false, OptionsCategory::OPTIONS);
|
||||
#ifndef WIN32
|
||||
gArgs.AddArg("-pid=<file>", strprintf("Specify pid file. Relative paths will be prefixed by a net-specific datadir location. (default: %s)", BITCOIN_PID_FILENAME), false, OptionsCategory::OPTIONS);
|
||||
#else
|
||||
hidden_args.emplace_back("-pid");
|
||||
#endif
|
||||
gArgs.AddArg("-prune=<n>", strprintf("Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. "
|
||||
"Warning: Reverting this setting requires re-downloading the entire blockchain. "
|
||||
"(default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, >=%u = automatically prune block files to stay under the specified target size in MiB)", MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024), false, OptionsCategory::OPTIONS);
|
||||
|
|
@ -1287,12 +1283,10 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
{
|
||||
const CChainParams& chainparams = Params();
|
||||
// ********************************************************* Step 4a: application initialization
|
||||
#ifndef WIN32
|
||||
if (!CreatePidFile()) {
|
||||
// Detailed error printed inside CreatePidFile().
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
if (LogInstance().m_print_to_file) {
|
||||
if (gArgs.GetBoolArg("-shrinkdebugfile", LogInstance().DefaultShrinkDebugFile())) {
|
||||
// Do this first since it both loads a bunch of debug.log into memory,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue