PIVX Core  5.6.99
P2P Digital Currency
Classes | Macros | Functions | Variables
init.cpp File Reference
#include "init.h"
#include "activemasternode.h"
#include "addrman.h"
#include "amount.h"
#include "bls/bls_wrapper.h"
#include "checkpoints.h"
#include "compat/sanity.h"
#include "consensus/upgrades.h"
#include "fs.h"
#include "httpserver.h"
#include "httprpc.h"
#include "invalid.h"
#include "key.h"
#include "mapport.h"
#include "miner.h"
#include "netbase.h"
#include "net_processing.h"
#include "policy/feerate.h"
#include "policy/policy.h"
#include "rpc/register.h"
#include "rpc/server.h"
#include "script/sigcache.h"
#include "script/standard.h"
#include "scheduler.h"
#include "shutdown.h"
#include "spork.h"
#include "sporkdb.h"
#include "tiertwo/init.h"
#include "txdb.h"
#include "torcontrol.h"
#include "guiinterface.h"
#include "guiinterfaceutil.h"
#include "util/system.h"
#include "utilmoneystr.h"
#include "util/threadnames.h"
#include "validation.h"
#include "validationinterface.h"
#include "warnings.h"
#include <atomic>
#include <fstream>
#include <stdint.h>
#include <stdio.h>
#include <memory>
#include <attributes.h>
#include <cerrno>
#include <signal.h>
#include <sys/stat.h>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/thread.hpp>

Go to the source code of this file.

Classes

class  CCoinsViewErrorCatcher
 
struct  CImportingNow
 

Macros

#define MIN_CORE_FILEDESCRIPTORS   150
 

Functions

fs::path GetPidFile ()
 
void Interrupt ()
 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 ThreadImport (const std::vector< fs::path > &vImportFiles)
 
bool InitSanityCheck (void)
 Sanity checks Ensure that PIVX is running in a usable environment with all necessary library support. More...
 
bool AppInitServers ()
 
bool AppInitBasicSetup ()
 Initialize PIVX core: Basic context setup. More...
 
void InitParameterInteraction ()
 Parameter interaction: change current parameters depending on various rules. More...
 
bool InitNUParams ()
 
void InitLogging ()
 Initialize the logging infrastructure. More...
 
bool AppInitParameterInteraction ()
 Initialization: parameter interaction. More...
 
bool AppInitSanityChecks ()
 Initialization sanity checks: ecc init, sanity checks, dir lock. More...
 
bool AppInitMain ()
 Bitcoin core main initialization. More...
 

Variables

volatile bool fFeeEstimatesInitialized = false
 
std::unique_ptr< CConnmang_connman
 
std::unique_ptr< PeerLogicValidationpeerLogic
 
CClientUIInterface uiInterface
 
const char *const PIVX_PID_FILENAME = "pivx.pid"
 The PID file facilities. More...
 

Macro Definition Documentation

◆ MIN_CORE_FILEDESCRIPTORS

#define MIN_CORE_FILEDESCRIPTORS   150

Definition at line 103 of file init.cpp.

Function Documentation

◆ AppInitBasicSetup()

bool AppInitBasicSetup ( )

Initialize PIVX core: Basic context setup.

Note
This can be done before daemonization. Do not call Shutdown() if this function fails.
Precondition
Parameters should be parsed and config file should be read.

Definition at line 805 of file init.cpp.

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

◆ AppInitMain()

bool AppInitMain ( )

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 1168 of file init.cpp.

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.
Todo:
*** do we still need this after -printtoconsole is gone?

Definition at line 974 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 1151 of file init.cpp.

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

◆ AppInitServers()

bool AppInitServers ( )

Definition at line 765 of file init.cpp.

Here is the call graph for this function:

◆ GetPidFile()

fs::path GetPidFile ( )

Definition at line 116 of file init.cpp.

Here is the call graph for this function:

◆ HandleSIGHUP()

void HandleSIGHUP ( int  )

Definition at line 342 of file init.cpp.

◆ HandleSIGTERM()

void HandleSIGTERM ( int  )

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

Definition at line 337 of file init.cpp.

Here is the call graph for this function:

◆ HelpMessage()

std::string HelpMessage ( HelpMessageMode  mode)

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

Definition at line 381 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 949 of file init.cpp.

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

◆ InitNUParams()

bool InitNUParams ( )

Definition at line 909 of file init.cpp.

Here is the call graph for this function:

◆ InitParameterInteraction()

void InitParameterInteraction ( )

Parameter interaction: change current parameters depending on various rules.

Definition at line 856 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 PIVX is running in a usable environment with all necessary library support.

Definition at line 714 of file init.cpp.

Here is the call graph for this function:

◆ Interrupt()

void Interrupt ( )

Interrupt threads.

Definition at line 186 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 570 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 372 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 358 of file init.cpp.

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

◆ OnRPCStopped()

void OnRPCStopped ( )
Todo:
: remove unused parameter fInitialDownload

Definition at line 363 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 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 199 of file init.cpp.

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

◆ ThreadImport()

void ThreadImport ( const std::vector< fs::path > &  vImportFiles)

Definition at line 635 of file init.cpp.

Here is the call graph for this function:

Variable Documentation

◆ fFeeEstimatesInitialized

volatile bool fFeeEstimatesInitialized = false

Definition at line 84 of file init.cpp.

◆ g_connman

std::unique_ptr<CConnman> g_connman

Definition at line 90 of file init.cpp.

◆ peerLogic

std::unique_ptr<PeerLogicValidation> peerLogic

Definition at line 91 of file init.cpp.

◆ PIVX_PID_FILENAME

const char* const PIVX_PID_FILENAME = "pivx.pid"

The PID file facilities.

Definition at line 114 of file init.cpp.

◆ uiInterface

CClientUIInterface uiInterface

Definition at line 109 of file init.cpp.