Bitcoin Core
27.99.0
P2P Digital Currency
|
#include <init.h>
#include <kernel/checks.h>
#include <kernel/mempool_persist.h>
#include <kernel/validation_cache_sizes.h>
#include <addrman.h>
#include <banman.h>
#include <blockfilter.h>
#include <chain.h>
#include <chainparams.h>
#include <chainparamsbase.h>
#include <clientversion.h>
#include <common/args.h>
#include <common/system.h>
#include <consensus/amount.h>
#include <deploymentstatus.h>
#include <hash.h>
#include <httprpc.h>
#include <httpserver.h>
#include <index/blockfilterindex.h>
#include <index/coinstatsindex.h>
#include <index/txindex.h>
#include <init/common.h>
#include <interfaces/chain.h>
#include <interfaces/init.h>
#include <interfaces/node.h>
#include <logging.h>
#include <mapport.h>
#include <net.h>
#include <net_permissions.h>
#include <net_processing.h>
#include <netbase.h>
#include <netgroup.h>
#include <node/blockmanager_args.h>
#include <node/blockstorage.h>
#include <node/caches.h>
#include <node/chainstate.h>
#include <node/chainstatemanager_args.h>
#include <node/context.h>
#include <node/interface_ui.h>
#include <node/kernel_notifications.h>
#include <node/mempool_args.h>
#include <node/mempool_persist_args.h>
#include <node/miner.h>
#include <node/peerman_args.h>
#include <node/validation_cache_args.h>
#include <policy/feerate.h>
#include <policy/fees.h>
#include <policy/fees_args.h>
#include <policy/policy.h>
#include <policy/settings.h>
#include <protocol.h>
#include <rpc/blockchain.h>
#include <rpc/register.h>
#include <rpc/server.h>
#include <rpc/util.h>
#include <scheduler.h>
#include <script/sigcache.h>
#include <sync.h>
#include <timedata.h>
#include <torcontrol.h>
#include <txdb.h>
#include <txmempool.h>
#include <util/asmap.h>
#include <util/chaintype.h>
#include <util/check.h>
#include <util/fs.h>
#include <util/fs_helpers.h>
#include <util/moneystr.h>
#include <util/result.h>
#include <util/strencodings.h>
#include <util/string.h>
#include <util/syserror.h>
#include <util/thread.h>
#include <util/threadnames.h>
#include <util/time.h>
#include <util/translation.h>
#include <validation.h>
#include <validationinterface.h>
#include <walletinitinterface.h>
#include <algorithm>
#include <condition_variable>
#include <cstdint>
#include <cstdio>
#include <fstream>
#include <functional>
#include <set>
#include <string>
#include <thread>
#include <vector>
#include <cerrno>
#include <signal.h>
#include <sys/stat.h>
#include <boost/signals2/signal.hpp>
Go to the source code of this file.
Macros | |
#define | MIN_CORE_FILEDESCRIPTORS 150 |
Functions | |
static fs::path | GetPidFile (const ArgsManager &args) |
static bool | CreatePidFile (const ArgsManager &args) |
static void | RemovePidFile (const ArgsManager &args) |
void | InitContext (NodeContext &node) |
Initialize node context shutdown and args variables. More... | |
bool | ShutdownRequested (node::NodeContext &node) |
Return whether node shutdown was requested. More... | |
void | Interrupt (NodeContext &node) |
Interrupt threads. More... | |
void | Shutdown (NodeContext &node) |
static void | HandleSIGTERM (int) |
Signal handlers are very limited in what they are allowed to do. More... | |
static void | HandleSIGHUP (int) |
static void | registerSignalHandler (int signal, void(*handler)(int)) |
static void | OnRPCStarted () |
static void | OnRPCStopped () |
void | SetupServerArgs (ArgsManager &argsman) |
Register all arguments with the ArgsManager. More... | |
static void | BlockNotifyGenesisWait (const CBlockIndex *pBlockIndex) |
static bool | AppInitServers (NodeContext &node) |
void | InitParameterInteraction (ArgsManager &args) |
Parameter interaction: change current parameters depending on various rules. More... | |
void | InitLogging (const ArgsManager &args) |
Initialize global loggers. More... | |
static void | new_handler_terminate () |
bool | AppInitBasicSetup (const ArgsManager &args, std::atomic< int > &exit_status) |
Initialize bitcoin core: Basic context setup. More... | |
bool | AppInitParameterInteraction (const ArgsManager &args) |
Initialization: parameter interaction. More... | |
static bool | LockDataDirectory (bool probeOnly) |
bool | AppInitSanityChecks (const kernel::Context &kernel) |
Initialization sanity checks. More... | |
bool | AppInitLockDataDirectory () |
Lock bitcoin core data directory. More... | |
bool | AppInitInterfaces (NodeContext &node) |
Initialize node and wallet interface pointers. More... | |
bool | AppInitMain (NodeContext &node, interfaces::BlockAndHeaderTipInfo *tip_info) |
Bitcoin core main initialization. More... | |
bool | StartIndexBackgroundSync (NodeContext &node) |
Validates requirements to run the indexes and spawns each index initial sync thread. More... | |
Variables | |
static constexpr bool | DEFAULT_PROXYRANDOMIZE {true} |
static constexpr bool | DEFAULT_REST_ENABLE {false} |
static constexpr bool | DEFAULT_I2P_ACCEPT_INCOMING {true} |
static constexpr bool | DEFAULT_STOPAFTERBLOCKIMPORT {false} |
static const char * | DEFAULT_ASMAP_FILENAME ="ip_asn.map" |
static const char * | BITCOIN_PID_FILENAME = "bitcoind.pid" |
The PID file facilities. More... | |
static bool | g_generated_pid {false} |
True if this process has created a PID file. More... | |
static std::optional< util::SignalInterrupt > | g_shutdown |
static boost::signals2::connection | rpc_notify_block_change_connection |
static bool | fHaveGenesis = false |
static GlobalMutex | g_genesis_wait_mutex |
static std::condition_variable | g_genesis_wait_cv |
bool AppInitBasicSetup | ( | const ArgsManager & | args, |
std::atomic< int > & | exit_status | ||
) |
Initialize bitcoin core: Basic context setup.
Definition at line 849 of file init.cpp.
bool AppInitInterfaces | ( | node::NodeContext & | node | ) |
bool AppInitLockDataDirectory | ( | ) |
Lock bitcoin core data directory.
Definition at line 1103 of file init.cpp.
bool AppInitMain | ( | node::NodeContext & | node, |
interfaces::BlockAndHeaderTipInfo * | tip_info = nullptr |
||
) |
Bitcoin core main initialization.
Definition at line 1121 of file init.cpp.
bool AppInitParameterInteraction | ( | const ArgsManager & | args | ) |
Initialization: parameter interaction.
Definition at line 886 of file init.cpp.
bool AppInitSanityChecks | ( | const kernel::Context & | kernel | ) |
Initialization sanity checks.
Definition at line 1088 of file init.cpp.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
void InitContext | ( | NodeContext & | node | ) |
void InitLogging | ( | const ArgsManager & | args | ) |
Initialize global loggers.
Initialize the logging infrastructure.
Note that this is called very early in the process lifetime, so you should be careful about what global state you rely on here.
Definition at line 819 of file init.cpp.
void InitParameterInteraction | ( | ArgsManager & | args | ) |
void Interrupt | ( | NodeContext & | node | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
void SetupServerArgs | ( | ArgsManager & | argsman | ) |
Register all arguments with the ArgsManager.
Definition at line 438 of file init.cpp.
void Shutdown | ( | NodeContext & | node | ) |
Note: Shutdown() must be able to handle cases in which initialization failed part of the way, for example if the data directory was found to be locked. Be sure that anything that writes files or flushes caches only does this if the respective module was initialized.
Definition at line 264 of file init.cpp.
bool ShutdownRequested | ( | node::NodeContext & | node | ) |
bool StartIndexBackgroundSync | ( | NodeContext & | node | ) |
|
static |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
static |
|
static |
|
static |