PRCYCoin  2.0.0.7rc1
P2P Digital Currency
Classes | Macros | Enumerations | Functions | Variables
init.cpp File Reference
#include "init.h"
#include "activemasternode.h"
#include "addrman.h"
#include "amount.h"
#include "checkpoints.h"
#include "compat/sanity.h"
#include "fs.h"
#include "httpserver.h"
#include "httprpc.h"
#include "invalid.h"
#include "key.h"
#include "main.h"
#include "masternode-budget.h"
#include "masternode-payments.h"
#include "masternodeconfig.h"
#include "masternodeman.h"
#include "messagesigner.h"
#include "miner.h"
#include "netbase.h"
#include "net.h"
#include "rpc/server.h"
#include "script/standard.h"
#include "script/sigcache.h"
#include "scheduler.h"
#include "txdb.h"
#include "torcontrol.h"
#include "guiinterface.h"
#include "guiinterfaceutil.h"
#include "util.h"
#include "utilmoneystr.h"
#include "util/threadnames.h"
#include "validationinterface.h"
#include <fstream>
#include <stdint.h>
#include <stdio.h>
#include <signal.h>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/foreach.hpp>
#include <boost/interprocess/sync/file_lock.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
 
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

void StartShutdown ()
 
bool ShutdownRequested ()
 
void Interrupt ()
 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 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 (std::vector< fs::path > vImportFiles)
 
bool InitSanityCheck (void)
 Sanity checks Ensure that PRCY is running in a usable environment with all necessary library support. More...
 
bool AppInitServers ()
 
bool AppInitBasicSetup ()
 Initialize PRCY: Basic context setup. More...
 
void InitParameterInteraction ()
 Parameter interaction: change current parameters depending on various rules. More...
 
void InitLogging ()
 Initialize the logging infrastructure. More...
 
bool AppInit2 (bool isDaemon)
 Initialize prcy. More...
 

Variables

volatile bool fFeeEstimatesInitialized = false
 
volatile bool fRestartRequested = false
 
CClientUIInterface uiInterface
 
volatile bool fRequestShutdown = false
 

Macro Definition Documentation

◆ MIN_CORE_FILEDESCRIPTORS

#define MIN_CORE_FILEDESCRIPTORS   150

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

Function Documentation

◆ AppInit2()

bool AppInit2 ( bool  isDaemon)

Initialize prcy.

Precondition
Parameters should be parsed and config file should be read.
Todo:
*** do we still need this after -printtoconsole is gone?

Definition at line 909 of file init.cpp.

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

◆ AppInitBasicSetup()

bool AppInitBasicSetup ( )

Initialize PRCY: 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 764 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 733 of file init.cpp.

Here is the call graph for this function:

◆ HandleSIGHUP()

void HandleSIGHUP ( int  )

Definition at line 299 of file init.cpp.

◆ HandleSIGTERM()

void HandleSIGTERM ( int  )

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

Definition at line 294 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 354 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 880 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 811 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 PRCY 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 166 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 574 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 341 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 328 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 333 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.

Definition at line 176 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 274 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 135 of file init.cpp.

Here is the caller graph for this function:

◆ StartShutdown()

void StartShutdown ( )

Definition at line 131 of file init.cpp.

Here is the caller graph for this function:

◆ ThreadImport()

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

Definition at line 651 of file init.cpp.

Here is the call graph for this function:

Variable Documentation

◆ fFeeEstimatesInitialized

volatile bool fFeeEstimatesInitialized = false

Definition at line 76 of file init.cpp.

◆ fRequestShutdown

volatile bool fRequestShutdown = false

Definition at line 129 of file init.cpp.

◆ fRestartRequested

volatile bool fRestartRequested = false

Definition at line 77 of file init.cpp.

◆ uiInterface

CClientUIInterface uiInterface

Definition at line 101 of file init.cpp.