Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | |||||
#include "zmq/zmqnotificationinterface.h" | #include "zmq/zmqnotificationinterface.h" | ||||
#endif | #endif | ||||
bool fFeeEstimatesInitialized = false; | bool fFeeEstimatesInitialized = false; | ||||
static const bool DEFAULT_PROXYRANDOMIZE = true; | static const bool DEFAULT_PROXYRANDOMIZE = true; | ||||
static const bool DEFAULT_REST_ENABLE = false; | static const bool DEFAULT_REST_ENABLE = false; | ||||
static const bool DEFAULT_DISABLE_SAFEMODE = false; | static const bool DEFAULT_DISABLE_SAFEMODE = false; | ||||
static const bool DEFAULT_STOPAFTERBLOCKIMPORT = false; | static const bool DEFAULT_STOPAFTERBLOCKIMPORT = false; | ||||
//! if set, all addresses will be encoded with cashaddr instead of base58 | |||||
static const bool DEFAULT_USE_CASHADDR = false; | |||||
std::unique_ptr<CConnman> g_connman; | std::unique_ptr<CConnman> g_connman; | ||||
std::unique_ptr<PeerLogicValidation> peerLogic; | std::unique_ptr<PeerLogicValidation> peerLogic; | ||||
#if ENABLE_ZMQ | #if ENABLE_ZMQ | ||||
static CZMQNotificationInterface *pzmqNotificationInterface = nullptr; | static CZMQNotificationInterface *pzmqNotificationInterface = nullptr; | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 331 Lines • ▼ Show 20 Lines | strUsage += HelpMessageOpt( | ||||
"-sysperms", | "-sysperms", | ||||
_("Create new files with system default permissions, instead of umask " | _("Create new files with system default permissions, instead of umask " | ||||
"077 (only effective with disabled wallet functionality)")); | "077 (only effective with disabled wallet functionality)")); | ||||
#endif | #endif | ||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
"-txindex", strprintf(_("Maintain a full transaction index, used by " | "-txindex", strprintf(_("Maintain a full transaction index, used by " | ||||
"the getrawtransaction rpc call (default: %d)"), | "the getrawtransaction rpc call (default: %d)"), | ||||
DEFAULT_TXINDEX)); | DEFAULT_TXINDEX)); | ||||
strUsage += HelpMessageOpt( | |||||
"-usecashaddr", strprintf(_("Use Cash Address for destination encoding " | |||||
"instead of base58 (default %d)"), | |||||
DEFAULT_USE_CASHADDR)); | |||||
strUsage += HelpMessageGroup(_("Connection options:")); | strUsage += HelpMessageGroup(_("Connection options:")); | ||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
"-addnode=<ip>", | "-addnode=<ip>", | ||||
_("Add a node to connect to and attempt to keep the connection open")); | _("Add a node to connect to and attempt to keep the connection open")); | ||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
"-banscore=<n>", | "-banscore=<n>", | ||||
strprintf( | strprintf( | ||||
▲ Show 20 Lines • Show All 1,139 Lines • ▼ Show 20 Lines | if (mapMultiArgs.count("-bip9params")) { | ||||
} | } | ||||
} | } | ||||
if (!found) { | if (!found) { | ||||
return InitError( | return InitError( | ||||
strprintf("Invalid deployment (%s)", vDeploymentParams[0])); | strprintf("Invalid deployment (%s)", vDeploymentParams[0])); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
static bool LockDataDirectory(bool probeOnly) { | static bool LockDataDirectory(bool probeOnly) { | ||||
std::string strDataDir = GetDataDir().string(); | std::string strDataDir = GetDataDir().string(); | ||||
// Make sure only a single Bitcoin process is using the data directory. | // Make sure only a single Bitcoin process is using the data directory. | ||||
boost::filesystem::path pathLockFile = GetDataDir() / ".lock"; | boost::filesystem::path pathLockFile = GetDataDir() / ".lock"; | ||||
▲ Show 20 Lines • Show All 497 Lines • ▼ Show 20 Lines | #endif | ||||
boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME; | boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME; | ||||
CAutoFile est_filein(fopen(est_path.string().c_str(), "rb"), SER_DISK, | CAutoFile est_filein(fopen(est_path.string().c_str(), "rb"), SER_DISK, | ||||
CLIENT_VERSION); | CLIENT_VERSION); | ||||
// Allowed to fail as this file IS missing on first startup. | // Allowed to fail as this file IS missing on first startup. | ||||
if (!est_filein.IsNull()) mempool.ReadFeeEstimates(est_filein); | if (!est_filein.IsNull()) mempool.ReadFeeEstimates(est_filein); | ||||
fFeeEstimatesInitialized = true; | fFeeEstimatesInitialized = true; | ||||
// Encoded addresses using cashaddr instead of base58 | |||||
config.SetCashAddrEncoding( | |||||
GetBoolArg("-usecashaddr", DEFAULT_USE_CASHADDR)); | |||||
// Step 8: load wallet | // Step 8: load wallet | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
if (!CWallet::InitLoadWallet()) return false; | if (!CWallet::InitLoadWallet()) return false; | ||||
#else | #else | ||||
LogPrintf("No wallet support compiled in!\n"); | LogPrintf("No wallet support compiled in!\n"); | ||||
#endif | #endif | ||||
// Step 9: data directory maintenance | // Step 9: data directory maintenance | ||||
▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines |