Dogecoin Core  1.14.2
P2P Digital Currency
Classes | Macros | Enumerations | Functions | Variables
init.cpp File Reference
#include "init.h"
#include "addrman.h"
#include "amount.h"
#include "chain.h"
#include "chainparams.h"
#include "checkpoints.h"
#include "compat/sanity.h"
#include "consensus/validation.h"
#include "httpserver.h"
#include "httprpc.h"
#include "key.h"
#include "validation.h"
#include "miner.h"
#include "netbase.h"
#include "net.h"
#include "net_processing.h"
#include "policy/policy.h"
#include "rpc/server.h"
#include "rpc/register.h"
#include "script/standard.h"
#include "script/sigcache.h"
#include "scheduler.h"
#include "timedata.h"
#include "txdb.h"
#include "txmempool.h"
#include "torcontrol.h"
#include "ui_interface.h"
#include "util.h"
#include "utilmoneystr.h"
#include "validationinterface.h"
#include "warnings.h"
#include <stdint.h>
#include <stdio.h>
#include <memory>
#include <signal.h>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/bind/bind.hpp>
#include <boost/filesystem.hpp>
#include <boost/function.hpp>
#include <boost/interprocess/sync/file_lock.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/thread.hpp>
#include <openssl/crypto.h>
Include dependency graph for init.cpp:

Go to the source code of this file.

Classes

class  CCoinsViewErrorCatcher
 This is a minimally invasive approach to shutdown on LevelDB read errors from the chainstate, while keeping user interface out of the common library, which is shared between bitcoind, and bitcoin-qt and non-server tools. More...
 
struct  CImportingNow
 

Macros

#define MIN_CORE_FILEDESCRIPTORS   150
 

Enumerations

enum  BindFlags { BF_NONE = 0 , BF_EXPLICIT = (1U << 0) , BF_REPORT_ERROR = (1U << 1) , BF_WHITELIST = (1U << 2) }
 Used to pass flags to the Bind() function. More...
 

Functions

std::atomic< bool > fRequestShutdown (false)
 
std::atomic< bool > fDumpMempoolLater (false)
 
void StartShutdown ()
 
bool ShutdownRequested ()
 
void Interrupt (boost::thread_group &threadGroup)
 Interrupt threads. More...
 
void Shutdown ()
 
void HandleSIGTERM (int)
 Signal handlers are very limited in what they are allowed to do, so: More...
 
void HandleSIGHUP (int)
 
void OnRPCStarted ()
 
void OnRPCStopped ()
 
void OnRPCPreCommand (const CRPCCommand &cmd)
 
std::string HelpMessage (HelpMessageMode mode)
 Help for options shared between UI and daemon (for -help) More...
 
std::string LicenseInfo ()
 Returns licensing information (for -version) More...
 
void CleanupBlockRevFiles ()
 
void ThreadImport (std::vector< boost::filesystem::path > vImportFiles)
 
bool InitSanityCheck (void)
 Sanity checks Ensure that Bitcoin is running in a usable environment with all necessary library support. More...
 
bool AppInitServers (boost::thread_group &threadGroup)
 
void InitParameterInteraction ()
 Parameter interaction: change current parameters depending on various rules. More...
 
void InitLogging ()
 Initialize the logging infrastructure. More...
 
bool AppInitBasicSetup ()
 Initialize bitcoin core: Basic context setup. More...
 
bool AppInitParameterInteraction ()
 Initialization: parameter interaction. More...
 
bool AppInitSanityChecks ()
 Initialization sanity checks: ecc init, sanity checks, dir lock. More...
 
bool AppInitMain (boost::thread_group &threadGroup, CScheduler &scheduler)
 Bitcoin core main initialization. More...
 

Variables

bool fFeeEstimatesInitialized = false
 
std::unique_ptr< CConnmang_connman
 
std::unique_ptr< PeerLogicValidationpeerLogic
 

Macro Definition Documentation

◆ MIN_CORE_FILEDESCRIPTORS

#define MIN_CORE_FILEDESCRIPTORS   150

Definition at line 88 of file init.cpp.

Enumeration Type Documentation

◆ BindFlags

enum BindFlags

Used to pass flags to the Bind() function.

Enumerator
BF_NONE 
BF_EXPLICIT 
BF_REPORT_ERROR 
BF_WHITELIST 

Definition at line 92 of file init.cpp.

Function Documentation

◆ AppInitBasicSetup()

bool AppInitBasicSetup ( )

Initialize bitcoin core: Basic context setup.

Note
This can be done before daemonization.
Precondition
Parameters should be parsed and config file should be read.

Definition at line 821 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AppInitMain()

bool AppInitMain ( boost::thread_group &  threadGroup,
CScheduler scheduler 
)

Bitcoin core main initialization.

Note
This should only be done after daemonization.
Precondition
Parameters should be parsed and config file should be read, AppInitSanityChecks should have been called.

Definition at line 1156 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AppInitParameterInteraction()

bool AppInitParameterInteraction ( )

Initialization: parameter interaction.

Note
This can be done before daemonization.
Precondition
Parameters should be parsed and config file should be read, AppInitBasicSetup should have been called.

Definition at line 879 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AppInitSanityChecks()

bool AppInitSanityChecks ( )

Initialization sanity checks: ecc init, sanity checks, dir lock.

Note
This can be done before daemonization.
Precondition
Parameters should be parsed and config file should be read, AppInitParameterInteraction should have been called.

Definition at line 1140 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AppInitServers()

bool AppInitServers ( boost::thread_group &  threadGroup)

Definition at line 700 of file init.cpp.

Here is the call graph for this function:

◆ CleanupBlockRevFiles()

void CleanupBlockRevFiles ( )

Definition at line 579 of file init.cpp.

Here is the call graph for this function:

◆ fDumpMempoolLater()

std::atomic<bool> fDumpMempoolLater ( false  )
Here is the caller graph for this function:

◆ fRequestShutdown()

std::atomic<bool> fRequestShutdown ( false  )
Here is the caller graph for this function:

◆ HandleSIGHUP()

void HandleSIGHUP ( int  )

Definition at line 281 of file init.cpp.

Here is the caller graph for this function:

◆ HandleSIGTERM()

void HandleSIGTERM ( int  )

Signal handlers are very limited in what they are allowed to do, so:

Definition at line 276 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HelpMessage()

std::string HelpMessage ( HelpMessageMode  mode)

Help for options shared between UI and daemon (for -help)

Definition at line 319 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitLogging()

void InitLogging ( )

Initialize the logging infrastructure.

Definition at line 787 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitParameterInteraction()

void InitParameterInteraction ( )

Parameter interaction: change current parameters depending on various rules.

Definition at line 719 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitSanityCheck()

bool InitSanityCheck ( void  )

Sanity checks Ensure that Bitcoin is running in a usable environment with all necessary library support.

Definition at line 688 of file init.cpp.

Here is the call graph for this function:

◆ Interrupt()

void Interrupt ( boost::thread_group &  threadGroup)

Interrupt threads.

Definition at line 172 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LicenseInfo()

std::string LicenseInfo ( )

Returns licensing information (for -version)

Definition at line 510 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnRPCPreCommand()

void OnRPCPreCommand ( const CRPCCommand cmd)

Definition at line 310 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnRPCStarted()

void OnRPCStarted ( )

Definition at line 297 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnRPCStopped()

void OnRPCStopped ( )

Definition at line 302 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Shutdown()

void Shutdown ( )

Note: Shutdown() must be able to handle cases in which AppInit2() 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 184 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShutdownRequested()

bool ShutdownRequested ( )

Definition at line 138 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartShutdown()

void StartShutdown ( )

Definition at line 134 of file init.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ThreadImport()

void ThreadImport ( std::vector< boost::filesystem::path >  vImportFiles)

Definition at line 614 of file init.cpp.

Here is the call graph for this function:

Variable Documentation

◆ fFeeEstimatesInitialized

bool fFeeEstimatesInitialized = false

Definition at line 69 of file init.cpp.

◆ g_connman

std::unique_ptr<CConnman> g_connman

Definition at line 75 of file init.cpp.

◆ peerLogic

std::unique_ptr<PeerLogicValidation> peerLogic

Definition at line 76 of file init.cpp.