Raven Core  3.0.0
P2P Digital Currency
Classes | Macros | 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 "fs.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/feerate.h"
#include "policy/fees.h"
#include "policy/policy.h"
#include "rpc/server.h"
#include "rpc/register.h"
#include "rpc/safemode.h"
#include "rpc/blockchain.h"
#include "rpc/mining.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 "assets/assets.h"
#include "assets/assetdb.h"
#include "warnings.h"
#include "tinyformat.h"
#include <stdint.h>
#include <stdio.h>
#include <memory>
#include <signal.h>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/bind.hpp>
#include <boost/interprocess/sync/file_lock.hpp>
#include <boost/thread.hpp>
#include <openssl/crypto.h>

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 ravend, and raven-qt and non-server tools. More...
 
struct  CImportingNow
 

Macros

#define MIN_CORE_FILEDESCRIPTORS   150
 

Functions

std::atomic< bool > fRequestShutdown (false)
 
std::atomic< bool > fRequestRestart (false)
 
std::atomic< bool > fDumpMempoolLater (false)
 
void StartShutdown ()
 
void StartRestart ()
 
bool ShutdownRequested ()
 
void Interrupt (boost::thread_group &threadGroup)
 Interrupt threads. More...
 
void PrepareShutdown ()
 Preparing steps before shutting down or restarting the wallet. More...
 
void Shutdown ()
 Shutdown is split into 2 parts: Part 1: shut down everything but the main wallet instance (done in PrepareShutdown() ) Part 2: delete wallet instance. More...
 
void OnRPCStarted ()
 
void OnRPCStopped ()
 
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< fs::path > vImportFiles)
 
bool InitSanityCheck (void)
 Sanity checks Ensure that Raven 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 raven core: Basic context setup. More...
 
bool AppInitParameterInteraction ()
 Initialization: parameter interaction. More...
 
bool AppInitSanityChecks ()
 Initialization sanity checks: ecc init, sanity checks, dir lock. More...
 
bool AppInitLockDataDirectory ()
 Lock raven core data directory. More...
 
bool AppInitMain (boost::thread_group &threadGroup, CScheduler &scheduler)
 Raven 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 94 of file init.cpp.

Function Documentation

◆ AppInitBasicSetup()

bool AppInitBasicSetup ( )

Initialize raven 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 923 of file init.cpp.

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

◆ AppInitLockDataDirectory()

bool AppInitLockDataDirectory ( )

Lock raven core data directory.

Note
This should only be done after daemonization. Do not call Shutdown() if this function fails.
Precondition
Parameters should be parsed and config file should be read, AppInitSanityChecks should have been called.

Definition at line 1279 of file init.cpp.

Here is the caller graph for this function:

◆ AppInitMain()

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

Raven core main initialization.

Note
This should only be done after daemonization. Call Shutdown() if this function fails.
Precondition
Parameters should be parsed and config file should be read, AppInitLockDataDirectory should have been called.

RVN START

RVN END

Definition at line 1291 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. Do not call Shutdown() if this function fails.
Precondition
Parameters should be parsed and config file should be read, AppInitBasicSetup should have been called.

Definition at line 971 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. Do not call Shutdown() if this function fails.
Precondition
Parameters should be parsed and config file should be read, AppInitParameterInteraction should have been called.

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

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

◆ CleanupBlockRevFiles()

void CleanupBlockRevFiles ( )

Definition at line 666 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:

◆ fRequestRestart()

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

◆ fRequestShutdown()

std::atomic<bool> fRequestShutdown ( false  )
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 391 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 890 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 813 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 Raven is running in a usable environment with all necessary library support.

Definition at line 777 of file init.cpp.

Here is the call graph for this function:

◆ Interrupt()

void Interrupt ( boost::thread_group &  threadGroup)

Interrupt threads.

Definition at line 169 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 597 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 378 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 383 of file init.cpp.

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

◆ PrepareShutdown()

void PrepareShutdown ( )

Preparing steps before shutting down or restarting the wallet.

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.

RVN START

RVN END

Definition at line 182 of file init.cpp.

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

◆ Shutdown()

void Shutdown ( )

Shutdown is split into 2 parts: Part 1: shut down everything but the main wallet instance (done in PrepareShutdown() ) Part 2: delete wallet instance.

In case of a restart PrepareShutdown() was already called before, but this method here gets called implicitly when the parent object is deleted. In this case we have to skip the PrepareShutdown() part because it was already executed and just delete the wallet instance.

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

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

◆ StartRestart()

void StartRestart ( )

Definition at line 132 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 128 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< fs::path >  vImportFiles)

Definition at line 701 of file init.cpp.

Here is the call graph for this function:

Variable Documentation

◆ fFeeEstimatesInitialized

bool fFeeEstimatesInitialized = false

Definition at line 76 of file init.cpp.

◆ g_connman

std::unique_ptr<CConnman> g_connman

Definition at line 81 of file init.cpp.

◆ peerLogic

std::unique_ptr<PeerLogicValidation> peerLogic

Definition at line 82 of file init.cpp.