![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
#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 "netfulfilledman.h"
#include "net_processing.h"
#include "policy/policy.h"
#include "rpc/server.h"
#include "script/standard.h"
#include "script/sigcache.h"
#include "scheduler.h"
#include "txdb.h"
#include "txmempool.h"
#include "torcontrol.h"
#include "ui_interface.h"
#include "util.h"
#include "utilmoneystr.h"
#include "utilstrencodings.h"
#include "validationinterface.h"
#include "activemasternode.h"
#include "dsnotificationinterface.h"
#include "flat-database.h"
#include "governance.h"
#include "instantx.h"
#include "masternode-payments.h"
#include "masternode-sync.h"
#include "masternodeman.h"
#include "masternodeconfig.h"
#include "messagesigner.h"
#include "privatesend-client.h"
#include "privatesend-server.h"
#include "spork.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.hpp>
#include <boost/filesystem.hpp>
#include <boost/function.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 |
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) } |
Functions | |
void | ThreadSendAlert (CConnman &connman) |
void | StartShutdown () |
bool | ShutdownRequested () |
void | Interrupt (boost::thread_group &threadGroup) |
void | PrepareShutdown () |
void | Shutdown () |
void | HandleSIGTERM (int) |
void | HandleSIGHUP (int) |
static bool | InitError (const std::string &str) |
static bool | InitWarning (const std::string &str) |
static bool | Bind (CConnman &connman, const CService &addr, unsigned int flags) |
void | OnRPCStopped () |
void | OnRPCPreCommand (const CRPCCommand &cmd) |
std::string | HelpMessage (HelpMessageMode mode) |
std::string | LicenseInfo () |
static void | BlockNotifyCallback (bool initialSync, const CBlockIndex *pBlockIndex) |
void | CleanupBlockRevFiles () |
void | ThreadImport (std::vector< boost::filesystem::path > vImportFiles) |
bool | InitSanityCheck (void) |
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 | AppInit2 (boost::thread_group &threadGroup, CScheduler &scheduler) |
Variables | |
bool | fFeeEstimatesInitialized = false |
bool | fRestartRequested = false |
static const bool | DEFAULT_PROXYRANDOMIZE = true |
static const bool | DEFAULT_REST_ENABLE = false |
static const bool | DEFAULT_DISABLE_SAFEMODE = false |
static const bool | DEFAULT_STOPAFTERBLOCKIMPORT = false |
std::unique_ptr< CConnman > | g_connman |
std::unique_ptr< PeerLogicValidation > | peerLogic |
static CDSNotificationInterface * | pdsNotificationInterface = NULL |
static const char * | FEE_ESTIMATES_FILENAME ="fee_estimates.dat" |
CClientUIInterface | uiInterface |
volatile bool | fRequestShutdown = false |
static CCoinsViewDB * | pcoinsdbview = NULL |
static CCoinsViewErrorCatcher * | pcoinscatcher = NULL |
static boost::scoped_ptr< ECCVerifyHandle > | globalVerifyHandle |
#define MIN_CORE_FILEDESCRIPTORS 150 |
Definition at line 118 of file init.cpp.
Referenced by AppInit2().
enum BindFlags |
bool AppInit2 | ( | boost::thread_group & | threadGroup, |
CScheduler & | scheduler | ||
) |
Initialize Dash Core.
Definition at line 942 of file init.cpp.
Referenced by AppInit(), and BitcoinCore::initialize().
bool AppInitServers | ( | boost::thread_group & | threadGroup | ) |
Definition at line 800 of file init.cpp.
Referenced by AppInit2().
Definition at line 357 of file init.cpp.
Referenced by AppInit2().
|
static |
Definition at line 652 of file init.cpp.
Referenced by AppInit2().
void CleanupBlockRevFiles | ( | ) |
Definition at line 683 of file init.cpp.
Referenced by AppInit2().
void HandleSIGHUP | ( | int | ) |
Definition at line 340 of file init.cpp.
Referenced by AppInit2().
void HandleSIGTERM | ( | int | ) |
Signal handlers are very limited in what they are allowed to do, so:
Definition at line 335 of file init.cpp.
Referenced by AppInit2().
std::string HelpMessage | ( | HelpMessageMode | mode | ) |
Help for options shared between UI and daemon (for -help)
Definition at line 384 of file init.cpp.
Referenced by AppInit(), and HelpMessageDialog::HelpMessageDialog().
|
static |
Definition at line 345 of file init.cpp.
Referenced by AppInit2(), Bind(), and InitSanityCheck().
void InitLogging | ( | ) |
Initialize the logging infrastructure.
Definition at line 926 of file init.cpp.
Referenced by AppInit(), and BitcoinApplication::parameterSetup().
void InitParameterInteraction | ( | ) |
Parameter interaction: change current parameters depending on various rules.
Definition at line 818 of file init.cpp.
Referenced by AppInit(), and BitcoinApplication::parameterSetup().
bool InitSanityCheck | ( | void | ) |
Sanity checks Ensure that Dash Core is running in a usable environment with all necessary library support.
Definition at line 788 of file init.cpp.
Referenced by AppInit2().
|
static |
Definition at line 351 of file init.cpp.
Referenced by AppInit2().
void Interrupt | ( | boost::thread_group & | threadGroup | ) |
Interrupt threads
Definition at line 197 of file init.cpp.
Referenced by AppInit(), BitcoinCore::shutdown(), and WaitForShutdown().
std::string LicenseInfo | ( | ) |
Returns licensing information (for -version)
Definition at line 637 of file init.cpp.
Referenced by AppInit(), and HelpMessageDialog::HelpMessageDialog().
void OnRPCPreCommand | ( | const CRPCCommand & | cmd | ) |
Definition at line 375 of file init.cpp.
Referenced by AppInitServers().
void OnRPCStopped | ( | ) |
Definition at line 369 of file init.cpp.
Referenced by AppInitServers().
void PrepareShutdown | ( | ) |
Preparing steps before shutting down or restarting the wallet
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 210 of file init.cpp.
Referenced by BitcoinCore::restart(), and 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 315 of file init.cpp.
Referenced by AppInit(), and BitcoinCore::shutdown().
bool ShutdownRequested | ( | ) |
Definition at line 168 of file init.cpp.
Referenced by ActivateBestChain(), CMasternode::Check(), BitcoinGUI::detectShutdown(), BitcoinGUI::handleRestart(), OverviewPage::privateSendStatus(), ThreadCheckPrivateSend(), ThreadCheckPrivateSendClient(), ThreadCheckPrivateSendServer(), ThreadSendAlert(), OverviewPage::updatePrivateSendProgress(), CVerifyDB::VerifyDB(), and WaitForShutdown().
void StartShutdown | ( | ) |
Definition at line 164 of file init.cpp.
Referenced by SplashScreen::closeEvent(), encryptwallet(), stop(), and ThreadImport().
void ThreadImport | ( | std::vector< boost::filesystem::path > | vImportFiles | ) |
Definition at line 719 of file init.cpp.
Referenced by AppInit2().
void ThreadSendAlert | ( | CConnman & | connman | ) |
Definition at line 26 of file sendalert.cpp.
Referenced by AppInit2().
|
static |
Definition at line 100 of file init.cpp.
Referenced by HelpMessage(), and OnRPCPreCommand().
|
static |
Definition at line 98 of file init.cpp.
Referenced by AppInit2(), and HelpMessage().
|
static |
Definition at line 99 of file init.cpp.
Referenced by AppInitServers(), and HelpMessage().
|
static |
Definition at line 101 of file init.cpp.
Referenced by HelpMessage(), and ThreadImport().
|
static |
Definition at line 129 of file init.cpp.
Referenced by AppInit2(), and PrepareShutdown().
bool fFeeEstimatesInitialized = false |
Definition at line 96 of file init.cpp.
Referenced by AppInit2(), and PrepareShutdown().
volatile bool fRequestShutdown = false |
Definition at line 162 of file init.cpp.
Referenced by AppInit2(), HandleSIGTERM(), PrepareShutdown(), ShutdownRequested(), and StartShutdown().
bool fRestartRequested = false |
Definition at line 97 of file init.cpp.
Referenced by PrepareShutdown(), Shutdown(), and ShutdownRequested().
std::unique_ptr<CConnman> g_connman |
Definition at line 103 of file init.cpp.
Referenced by addnode(), AppInit2(), RPCConsole::banSelectedNode(), clearbanned(), disconnectnode(), RPCConsole::disconnectSelectedNode(), getaddednodeinfo(), getblocktemplate(), getconnectioncount(), getinfo(), getnettotals(), ClientModel::getNetworkActive(), getnetworkinfo(), ClientModel::getNumConnections(), getpeerinfo(), ClientModel::getTotalBytesRecv(), ClientModel::getTotalBytesSent(), gobject(), Interrupt(), listbanned(), masternode(), masternodebroadcast(), mnsync(), ping(), PrepareShutdown(), privatesend(), OverviewPage::privateSendAuto(), BanTablePriv::refreshBanlist(), PeerTablePriv::refreshPeers(), CMasternodeVerification::Relay(), CDarkSendRelay::RelayThroughNode(), resendwallettransactions(), WalletModel::sendCoins(), sendmany(), SendMoney(), sendrawtransaction(), setban(), setgenerate(), ClientModel::setNetworkActive(), setnetworkactive(), spork(), MasternodeList::StartAlias(), MasternodeList::StartAll(), RPCConsole::unbanSelectedNode(), and voteraw().
|
static |
Definition at line 195 of file init.cpp.
Referenced by AppInit2(), and Shutdown().
|
static |
Definition at line 194 of file init.cpp.
Referenced by AppInit2(), and PrepareShutdown().
|
static |
Definition at line 193 of file init.cpp.
Referenced by AppInit2(), and PrepareShutdown().
|
static |
Definition at line 110 of file init.cpp.
Referenced by AppInit2(), and PrepareShutdown().
std::unique_ptr<PeerLogicValidation> peerLogic |
Definition at line 104 of file init.cpp.
Referenced by AppInit2(), and PrepareShutdown().
CClientUIInterface uiInterface |
Definition at line 130 of file init.cpp.
Referenced by ActivateBestChain(), AddTimeData(), AppInit2(), CVerifyDB::CVerifyDB(), CCoinsViewErrorCatcher::GetCoins(), InitError(), InitHTTPAllowList(), InitHTTPServer(), InitRPCAuthentication(), InitWarning(), InvalidateBlock(), CWallet::LoadWallet(), main(), NotifyHeaderTip(), noui_connect(), CAlert::ProcessAlert(), CMasternodeSync::ProcessTick(), CConnman::SetNetworkActive(), SplashScreen::subscribeToCoreSignals(), ClientModel::subscribeToCoreSignals(), BitcoinGUI::subscribeToCoreSignals(), CMasternodeSync::SwitchToNextAsset(), CWallet::TopUpKeyPool(), SplashScreen::unsubscribeFromCoreSignals(), ClientModel::unsubscribeFromCoreSignals(), BitcoinGUI::unsubscribeFromCoreSignals(), CVerifyDB::VerifyDB(), and CVerifyDB::~CVerifyDB().