mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Merge d960d5ca99 into merged_master (Bitcoin PR #16362)
This commit is contained in:
commit
83019c2acd
28 changed files with 264 additions and 200 deletions
147
src/init.cpp
147
src/init.cpp
|
|
@ -19,42 +19,43 @@
|
|||
#include <compat/sanity.h>
|
||||
#include <consensus/validation.h>
|
||||
#include <fs.h>
|
||||
#include <httpserver.h>
|
||||
#include <httprpc.h>
|
||||
#include <httpserver.h>
|
||||
#include <index/blockfilterindex.h>
|
||||
#include <interfaces/chain.h>
|
||||
#include <index/txindex.h>
|
||||
#include <interfaces/chain.h>
|
||||
#include <key.h>
|
||||
#include <mainchainrpc.h>
|
||||
#include <miner.h>
|
||||
#include <netbase.h>
|
||||
#include <net.h>
|
||||
#include <net_processing.h>
|
||||
#include <netbase.h>
|
||||
#include <policy/feerate.h>
|
||||
#include <policy/fees.h>
|
||||
#include <policy/policy.h>
|
||||
#include <policy/settings.h>
|
||||
#include <rpc/server.h>
|
||||
#include <rpc/register.h>
|
||||
#include <rpc/blockchain.h>
|
||||
#include <rpc/register.h>
|
||||
#include <rpc/server.h>
|
||||
#include <rpc/util.h>
|
||||
#include <script/standard.h>
|
||||
#include <script/sigcache.h>
|
||||
#include <scheduler.h>
|
||||
#include <script/sigcache.h>
|
||||
#include <script/standard.h>
|
||||
#include <shutdown.h>
|
||||
#include <util/threadnames.h>
|
||||
#include <timedata.h>
|
||||
#include <torcontrol.h>
|
||||
#include <txdb.h>
|
||||
#include <txmempool.h>
|
||||
#include <torcontrol.h>
|
||||
#include <ui_interface.h>
|
||||
#include <util/system.h>
|
||||
#include <util/moneystr.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/system.h>
|
||||
#include <util/threadnames.h>
|
||||
#include <util/translation.h>
|
||||
#include <util/validation.h>
|
||||
#include <validation.h>
|
||||
#include <validationinterface.h>
|
||||
#include <walletinitinterface.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
@ -124,7 +125,7 @@ NODISCARD static bool CreatePidFile()
|
|||
#endif
|
||||
return true;
|
||||
} else {
|
||||
return InitError(strprintf(_("Unable to create the PID file '%s': %s"), GetPidFile().string(), std::strerror(errno)));
|
||||
return InitError(strprintf(_("Unable to create the PID file '%s': %s").translated, GetPidFile().string(), std::strerror(errno)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -591,20 +592,20 @@ std::string LicenseInfo()
|
|||
const std::string URL_SOURCE_CODE = "<https://github.com/bitcoin/bitcoin>";
|
||||
const std::string URL_WEBSITE = "<https://bitcoincore.org>";
|
||||
|
||||
return CopyrightHolders(strprintf(_("Copyright (C) %i-%i"), 2009, COPYRIGHT_YEAR) + " ") + "\n" +
|
||||
return CopyrightHolders(strprintf(_("Copyright (C) %i-%i").translated, 2009, COPYRIGHT_YEAR) + " ") + "\n" +
|
||||
"\n" +
|
||||
strprintf(_("Please contribute if you find %s useful. "
|
||||
"Visit %s for further information about the software."),
|
||||
"Visit %s for further information about the software.").translated,
|
||||
PACKAGE_NAME, URL_WEBSITE) +
|
||||
"\n" +
|
||||
strprintf(_("The source code is available from %s."),
|
||||
strprintf(_("The source code is available from %s.").translated,
|
||||
URL_SOURCE_CODE) +
|
||||
"\n" +
|
||||
"\n" +
|
||||
_("This is experimental software.") + "\n" +
|
||||
strprintf(_("Distributed under the MIT software license, see the accompanying file %s or %s"), "COPYING", "<https://opensource.org/licenses/MIT>") + "\n" +
|
||||
_("This is experimental software.").translated + "\n" +
|
||||
strprintf(_("Distributed under the MIT software license, see the accompanying file %s or %s").translated, "COPYING", "<https://opensource.org/licenses/MIT>") + "\n" +
|
||||
"\n" +
|
||||
strprintf(_("This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard."), "<https://www.openssl.org>") +
|
||||
strprintf(_("This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.").translated, "<https://www.openssl.org>") +
|
||||
"\n";
|
||||
}
|
||||
|
||||
|
|
@ -870,7 +871,7 @@ void InitParameterInteraction()
|
|||
|
||||
static std::string ResolveErrMsg(const char * const optname, const std::string& strBind)
|
||||
{
|
||||
return strprintf(_("Cannot resolve -%s address: '%s'"), optname, strBind);
|
||||
return strprintf(_("Cannot resolve -%s address: '%s'").translated, optname, strBind);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -976,11 +977,11 @@ bool AppInitParameterInteraction()
|
|||
// on the command line or in this network's section of the config file.
|
||||
std::string network = gArgs.GetChainName();
|
||||
for (const auto& arg : gArgs.GetUnsuitableSectionOnlyArgs()) {
|
||||
return InitError(strprintf(_("Config setting for %s only applied on %s network when in [%s] section."), arg, network, network));
|
||||
return InitError(strprintf(_("Config setting for %s only applied on %s network when in [%s] section.").translated, arg, network, network));
|
||||
}
|
||||
|
||||
if (!fs::is_directory(GetBlocksDir())) {
|
||||
return InitError(strprintf(_("Specified blocks directory \"%s\" does not exist."), gArgs.GetArg("-blocksdir", "").c_str()));
|
||||
return InitError(strprintf(_("Specified blocks directory \"%s\" does not exist.").translated, gArgs.GetArg("-blocksdir", "").c_str()));
|
||||
}
|
||||
|
||||
// parse and validate enabled filter types
|
||||
|
|
@ -993,7 +994,7 @@ bool AppInitParameterInteraction()
|
|||
for (const auto& name : names) {
|
||||
BlockFilterType filter_type;
|
||||
if (!BlockFilterTypeByName(name, filter_type)) {
|
||||
return InitError(strprintf(_("Unknown -blockfilterindex value %s."), name));
|
||||
return InitError(strprintf(_("Unknown -blockfilterindex value %s.").translated, name));
|
||||
}
|
||||
g_enabled_filter_types.push_back(filter_type);
|
||||
}
|
||||
|
|
@ -1002,9 +1003,9 @@ bool AppInitParameterInteraction()
|
|||
// if using block pruning, then disallow txindex
|
||||
if (gArgs.GetArg("-prune", 0)) {
|
||||
if (gArgs.GetBoolArg("-txindex", DEFAULT_TXINDEX))
|
||||
return InitError(_("Prune mode is incompatible with -txindex."));
|
||||
return InitError(_("Prune mode is incompatible with -txindex.").translated);
|
||||
if (!g_enabled_filter_types.empty()) {
|
||||
return InitError(_("Prune mode is incompatible with -blockfilterindex."));
|
||||
return InitError(_("Prune mode is incompatible with -blockfilterindex.").translated);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1029,11 +1030,11 @@ bool AppInitParameterInteraction()
|
|||
#endif
|
||||
nMaxConnections = std::max(std::min<int>(nMaxConnections, fd_max - nBind - MIN_CORE_FILEDESCRIPTORS - MAX_ADDNODE_CONNECTIONS), 0);
|
||||
if (nFD < MIN_CORE_FILEDESCRIPTORS)
|
||||
return InitError(_("Not enough file descriptors available."));
|
||||
return InitError(_("Not enough file descriptors available.").translated);
|
||||
nMaxConnections = std::min(nFD - MIN_CORE_FILEDESCRIPTORS - MAX_ADDNODE_CONNECTIONS, nMaxConnections);
|
||||
|
||||
if (nMaxConnections < nUserMaxConnections)
|
||||
InitWarning(strprintf(_("Reducing -maxconnections from %d to %d, because of system limitations."), nUserMaxConnections, nMaxConnections));
|
||||
InitWarning(strprintf(_("Reducing -maxconnections from %d to %d, because of system limitations.").translated, nUserMaxConnections, nMaxConnections));
|
||||
|
||||
// ********************************************************* Step 3: parameter-to-internal-flags
|
||||
if (gArgs.IsArgSet("-debug")) {
|
||||
|
|
@ -1044,7 +1045,7 @@ bool AppInitParameterInteraction()
|
|||
[](std::string cat){return cat == "0" || cat == "none";})) {
|
||||
for (const auto& cat : categories) {
|
||||
if (!LogInstance().EnableCategory(cat)) {
|
||||
InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debug", cat));
|
||||
InitWarning(strprintf(_("Unsupported logging category %s=%s.").translated, "-debug", cat));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1053,7 +1054,7 @@ bool AppInitParameterInteraction()
|
|||
// Now remove the logging categories which were explicitly excluded
|
||||
for (const std::string& cat : gArgs.GetArgs("-debugexclude")) {
|
||||
if (!LogInstance().DisableCategory(cat)) {
|
||||
InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debugexclude", cat));
|
||||
InitWarning(strprintf(_("Unsupported logging category %s=%s.").translated, "-debugexclude", cat));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1089,7 +1090,7 @@ bool AppInitParameterInteraction()
|
|||
int64_t nMempoolSizeMax = gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000;
|
||||
int64_t nMempoolSizeMin = gArgs.GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) * 1000 * 40;
|
||||
if (nMempoolSizeMax < 0 || nMempoolSizeMax < nMempoolSizeMin)
|
||||
return InitError(strprintf(_("-maxmempool must be at least %d MB"), std::ceil(nMempoolSizeMin / 1000000.0)));
|
||||
return InitError(strprintf(_("-maxmempool must be at least %d MB").translated, std::ceil(nMempoolSizeMin / 1000000.0)));
|
||||
// incremental relay fee sets the minimum feerate increase necessary for BIP 125 replacement in the mempool
|
||||
// and the amount the mempool min fee increases above the feerate of txs evicted due to mempool limiting.
|
||||
if (gArgs.IsArgSet("-incrementalrelayfee"))
|
||||
|
|
@ -1112,7 +1113,7 @@ bool AppInitParameterInteraction()
|
|||
// block pruning; get the amount of disk space (in MiB) to allot for block & undo files
|
||||
int64_t nPruneArg = gArgs.GetArg("-prune", 0);
|
||||
if (nPruneArg < 0) {
|
||||
return InitError(_("Prune cannot be configured with a negative value."));
|
||||
return InitError(_("Prune cannot be configured with a negative value.").translated);
|
||||
}
|
||||
nPruneTarget = (uint64_t) nPruneArg * 1024 * 1024;
|
||||
if (nPruneArg == 1) { // manual pruning: -prune=1
|
||||
|
|
@ -1121,7 +1122,7 @@ bool AppInitParameterInteraction()
|
|||
fPruneMode = true;
|
||||
} else if (nPruneTarget) {
|
||||
if (nPruneTarget < MIN_DISK_SPACE_FOR_BLOCK_FILES) {
|
||||
return InitError(strprintf(_("Prune configured below the minimum of %d MiB. Please use a higher number."), MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024));
|
||||
return InitError(strprintf(_("Prune configured below the minimum of %d MiB. Please use a higher number.").translated, MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024));
|
||||
}
|
||||
LogPrintf("Prune configured to target %u MiB on disk for block and undo files.\n", nPruneTarget / 1024 / 1024);
|
||||
fPruneMode = true;
|
||||
|
|
@ -1210,10 +1211,10 @@ static bool LockDataDirectory(bool probeOnly)
|
|||
// Make sure only a single Bitcoin process is using the data directory.
|
||||
fs::path datadir = GetDataDir();
|
||||
if (!DirIsWritable(datadir)) {
|
||||
return InitError(strprintf(_("Cannot write to data directory '%s'; check permissions."), datadir.string()));
|
||||
return InitError(strprintf(_("Cannot write to data directory '%s'; check permissions.").translated, datadir.string()));
|
||||
}
|
||||
if (!LockDirectory(datadir, ".lock", probeOnly)) {
|
||||
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running."), datadir.string(), PACKAGE_NAME));
|
||||
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running.").translated, datadir.string(), PACKAGE_NAME));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1231,7 +1232,7 @@ bool AppInitSanityChecks()
|
|||
|
||||
// Sanity check
|
||||
if (!InitSanityCheck())
|
||||
return InitError(strprintf(_("Initialization sanity check failed. %s is shutting down."), PACKAGE_NAME));
|
||||
return InitError(strprintf(_("Initialization sanity check failed. %s is shutting down.").translated, PACKAGE_NAME));
|
||||
|
||||
// Probe the data directory lock to give an early error message, if possible
|
||||
// We cannot hold the data directory lock here, as the forking for daemon() hasn't yet happened,
|
||||
|
|
@ -1282,7 +1283,7 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
LogPrintf("Config file: %s\n", config_file_path.string());
|
||||
} else if (gArgs.IsArgSet("-conf")) {
|
||||
// Warn if no conf file exists at path provided by user
|
||||
InitWarning(strprintf(_("The specified config file %s does not exist\n"), config_file_path.string()));
|
||||
InitWarning(strprintf(_("The specified config file %s does not exist\n").translated, config_file_path.string()));
|
||||
} else {
|
||||
// Not categorizing as "Warning" because it's the default behavior
|
||||
LogPrintf("Config file: %s (not found, skipping)\n", config_file_path.string());
|
||||
|
|
@ -1348,7 +1349,7 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
{
|
||||
uiInterface.InitMessage_connect(SetRPCWarmupStatus);
|
||||
if (!AppInitServers())
|
||||
return InitError(_("Unable to start HTTP server. See debug log for details."));
|
||||
return InitError(_("Unable to start HTTP server. See debug log for details.").translated);
|
||||
}
|
||||
|
||||
// ********************************************************* Step 5: verify wallet database integrity
|
||||
|
|
@ -1376,12 +1377,12 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
std::vector<std::string> uacomments;
|
||||
for (const std::string& cmt : gArgs.GetArgs("-uacomment")) {
|
||||
if (cmt != SanitizeString(cmt, SAFE_CHARS_UA_COMMENT))
|
||||
return InitError(strprintf(_("User Agent comment (%s) contains unsafe characters."), cmt));
|
||||
return InitError(strprintf(_("User Agent comment (%s) contains unsafe characters.").translated, cmt));
|
||||
uacomments.push_back(cmt);
|
||||
}
|
||||
strSubVersion = FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, uacomments);
|
||||
if (strSubVersion.size() > MAX_SUBVERSION_LENGTH) {
|
||||
return InitError(strprintf(_("Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments."),
|
||||
return InitError(strprintf(_("Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.").translated,
|
||||
strSubVersion.size(), MAX_SUBVERSION_LENGTH));
|
||||
}
|
||||
|
||||
|
|
@ -1390,7 +1391,7 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
for (const std::string& snet : gArgs.GetArgs("-onlynet")) {
|
||||
enum Network net = ParseNetwork(snet);
|
||||
if (net == NET_UNROUTABLE)
|
||||
return InitError(strprintf(_("Unknown network specified in -onlynet: '%s'"), snet));
|
||||
return InitError(strprintf(_("Unknown network specified in -onlynet: '%s'").translated, snet));
|
||||
nets.insert(net);
|
||||
}
|
||||
for (int n = 0; n < NET_MAX; n++) {
|
||||
|
|
@ -1411,12 +1412,12 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
if (proxyArg != "" && proxyArg != "0") {
|
||||
CService proxyAddr;
|
||||
if (!Lookup(proxyArg.c_str(), proxyAddr, 9050, fNameLookup)) {
|
||||
return InitError(strprintf(_("Invalid -proxy address or hostname: '%s'"), proxyArg));
|
||||
return InitError(strprintf(_("Invalid -proxy address or hostname: '%s'").translated, proxyArg));
|
||||
}
|
||||
|
||||
proxyType addrProxy = proxyType(proxyAddr, proxyRandomize);
|
||||
if (!addrProxy.IsValid())
|
||||
return InitError(strprintf(_("Invalid -proxy address or hostname: '%s'"), proxyArg));
|
||||
return InitError(strprintf(_("Invalid -proxy address or hostname: '%s'").translated, proxyArg));
|
||||
|
||||
SetProxy(NET_IPV4, addrProxy);
|
||||
SetProxy(NET_IPV6, addrProxy);
|
||||
|
|
@ -1435,11 +1436,11 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
} else {
|
||||
CService onionProxy;
|
||||
if (!Lookup(onionArg.c_str(), onionProxy, 9050, fNameLookup)) {
|
||||
return InitError(strprintf(_("Invalid -onion address or hostname: '%s'"), onionArg));
|
||||
return InitError(strprintf(_("Invalid -onion address or hostname: '%s'").translated, onionArg));
|
||||
}
|
||||
proxyType addrOnion = proxyType(onionProxy, proxyRandomize);
|
||||
if (!addrOnion.IsValid())
|
||||
return InitError(strprintf(_("Invalid -onion address or hostname: '%s'"), onionArg));
|
||||
return InitError(strprintf(_("Invalid -onion address or hostname: '%s'").translated, onionArg));
|
||||
SetProxy(NET_ONION, addrOnion);
|
||||
SetReachable(NET_ONION, true);
|
||||
}
|
||||
|
|
@ -1514,7 +1515,7 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
bool fReset = fReindex;
|
||||
std::string strLoadError;
|
||||
|
||||
uiInterface.InitMessage(_("Loading block index..."));
|
||||
uiInterface.InitMessage(_("Loading block index...").translated);
|
||||
|
||||
do {
|
||||
const int64_t load_block_index_start_time = GetTimeMillis();
|
||||
|
|
@ -1545,7 +1546,7 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
// From here on out fReindex and fReset mean something different!
|
||||
if (!LoadBlockIndex(chainparams)) {
|
||||
if (ShutdownRequested()) break;
|
||||
strLoadError = _("Error loading block database");
|
||||
strLoadError = _("Error loading block database").translated;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1553,13 +1554,13 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
// (we're likely using a testnet datadir, or the other way around).
|
||||
if (!::BlockIndex().empty() &&
|
||||
!LookupBlockIndex(chainparams.GetConsensus().hashGenesisBlock)) {
|
||||
return InitError(_("Incorrect or no genesis block found. Wrong datadir for network?"));
|
||||
return InitError(_("Incorrect or no genesis block found. Wrong datadir for network?").translated);
|
||||
}
|
||||
|
||||
// Check for changed -prune state. What we are concerned about is a user who has pruned blocks
|
||||
// in the past, but is now trying to run unpruned.
|
||||
if (fHavePruned && !fPruneMode) {
|
||||
strLoadError = _("You need to rebuild the database using -reindex to go back to unpruned mode. This will redownload the entire blockchain");
|
||||
strLoadError = _("You need to rebuild the database using -reindex to go back to unpruned mode. This will redownload the entire blockchain").translated;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1568,7 +1569,7 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
// (otherwise we use the one already on disk).
|
||||
// This is called again in ThreadImport after the reindex completes.
|
||||
if (!fReindex && !LoadGenesisBlock(chainparams)) {
|
||||
strLoadError = _("Error initializing block database");
|
||||
strLoadError = _("Error initializing block database").translated;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1579,20 +1580,20 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
pcoinscatcher.reset(new CCoinsViewErrorCatcher(pcoinsdbview.get()));
|
||||
pcoinscatcher->AddReadErrCallback([]() {
|
||||
uiInterface.ThreadSafeMessageBox(
|
||||
_("Error reading from database, shutting down."),
|
||||
_("Error reading from database, shutting down.").translated,
|
||||
"", CClientUIInterface::MSG_ERROR);
|
||||
});
|
||||
|
||||
// If necessary, upgrade from older database format.
|
||||
// This is a no-op if we cleared the coinsviewdb with -reindex or -reindex-chainstate
|
||||
if (!pcoinsdbview->Upgrade()) {
|
||||
strLoadError = _("Error upgrading chainstate database");
|
||||
strLoadError = _("Error upgrading chainstate database").translated;
|
||||
break;
|
||||
}
|
||||
|
||||
// ReplayBlocks is a no-op if we cleared the coinsviewdb with -reindex or -reindex-chainstate
|
||||
if (!ReplayBlocks(chainparams, pcoinsdbview.get())) {
|
||||
strLoadError = _("Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.");
|
||||
strLoadError = _("Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.").translated;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1603,14 +1604,14 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
if (!is_coinsview_empty) {
|
||||
// LoadChainTip sets ::ChainActive() based on pcoinsTip's best block
|
||||
if (!LoadChainTip(chainparams)) {
|
||||
strLoadError = _("Error initializing block database");
|
||||
strLoadError = _("Error initializing block database").translated;
|
||||
break;
|
||||
}
|
||||
assert(::ChainActive().Tip() != nullptr);
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
LogPrintf("%s\n", e.what());
|
||||
strLoadError = _("Error opening block database");
|
||||
strLoadError = _("Error opening block database").translated;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1618,9 +1619,9 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
// Note that RewindBlockIndex MUST run even if we're about to -reindex-chainstate.
|
||||
// It both disconnects blocks based on ::ChainActive(), and drops block data in
|
||||
// BlockIndex() based on lack of available witness data.
|
||||
uiInterface.InitMessage(_("Rewinding blocks..."));
|
||||
uiInterface.InitMessage(_("Rewinding blocks...").translated);
|
||||
if (!RewindBlockIndex(chainparams)) {
|
||||
strLoadError = _("Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain");
|
||||
strLoadError = _("Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain").translated;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1628,7 +1629,7 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
try {
|
||||
LOCK(cs_main);
|
||||
if (!is_coinsview_empty) {
|
||||
uiInterface.InitMessage(_("Verifying blocks..."));
|
||||
uiInterface.InitMessage(_("Verifying blocks...").translated);
|
||||
if (fHavePruned && gArgs.GetArg("-checkblocks", DEFAULT_CHECKBLOCKS) > MIN_BLOCKS_TO_KEEP) {
|
||||
LogPrintf("Prune: pruned datadir may not have more than %d blocks; only checking available blocks\n",
|
||||
MIN_BLOCKS_TO_KEEP);
|
||||
|
|
@ -1639,19 +1640,19 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
if (tip && tip->nTime > GetAdjustedTime() + 2 * 60 * 60) {
|
||||
strLoadError = _("The block database contains a block which appears to be from the future. "
|
||||
"This may be due to your computer's date and time being set incorrectly. "
|
||||
"Only rebuild the block database if you are sure that your computer's date and time are correct");
|
||||
"Only rebuild the block database if you are sure that your computer's date and time are correct").translated;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!CVerifyDB().VerifyDB(chainparams, pcoinsdbview.get(), gArgs.GetArg("-checklevel", DEFAULT_CHECKLEVEL),
|
||||
gArgs.GetArg("-checkblocks", DEFAULT_CHECKBLOCKS))) {
|
||||
strLoadError = _("Corrupted block database detected");
|
||||
strLoadError = _("Corrupted block database detected").translated;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (const std::exception& e) {
|
||||
LogPrintf("%s\n", e.what());
|
||||
strLoadError = _("Error opening block database");
|
||||
strLoadError = _("Error opening block database").translated;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1663,7 +1664,7 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
// first suggest a reindex
|
||||
if (!fReset) {
|
||||
bool fRet = uiInterface.ThreadSafeQuestion(
|
||||
strLoadError + ".\n\n" + _("Do you want to rebuild the block database now?"),
|
||||
strLoadError + ".\n\n" + _("Do you want to rebuild the block database now?").translated,
|
||||
strLoadError + ".\nPlease restart with -reindex or -reindex-chainstate to recover.",
|
||||
"", CClientUIInterface::MSG_ERROR | CClientUIInterface::BTN_ABORT);
|
||||
if (fRet) {
|
||||
|
|
@ -1720,7 +1721,7 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
LogPrintf("Unsetting NODE_NETWORK on prune mode\n");
|
||||
nLocalServices = ServiceFlags(nLocalServices & ~NODE_NETWORK);
|
||||
if (!fReindex) {
|
||||
uiInterface.InitMessage(_("Pruning blockstore..."));
|
||||
uiInterface.InitMessage(_("Pruning blockstore...").translated);
|
||||
::ChainstateActive().PruneAndFlush();
|
||||
}
|
||||
}
|
||||
|
|
@ -1737,11 +1738,11 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
// ********************************************************* Step 11: import blocks
|
||||
|
||||
if (!CheckDiskSpace(GetDataDir())) {
|
||||
InitError(strprintf(_("Error: Disk space is low for %s"), GetDataDir()));
|
||||
InitError(strprintf(_("Error: Disk space is low for %s").translated, GetDataDir()));
|
||||
return false;
|
||||
}
|
||||
if (!CheckDiskSpace(GetBlocksDir())) {
|
||||
InitError(strprintf(_("Error: Disk space is low for %s"), GetBlocksDir()));
|
||||
InitError(strprintf(_("Error: Disk space is low for %s").translated, GetBlocksDir()));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1835,7 +1836,7 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
return InitError(ResolveErrMsg("whitebind", strBind));
|
||||
}
|
||||
if (addrBind.GetPort() == 0) {
|
||||
return InitError(strprintf(_("Need to specify a port with -whitebind: '%s'"), strBind));
|
||||
return InitError(strprintf(_("Need to specify a port with -whitebind: '%s'").translated, strBind));
|
||||
}
|
||||
connOptions.vWhiteBinds.push_back(addrBind);
|
||||
}
|
||||
|
|
@ -1844,7 +1845,7 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
CSubNet subnet;
|
||||
LookupSubNet(net.c_str(), subnet);
|
||||
if (!subnet.IsValid())
|
||||
return InitError(strprintf(_("Invalid netmask specified in -whitelist: '%s'"), net));
|
||||
return InitError(strprintf(_("Invalid netmask specified in -whitelist: '%s'").translated, net));
|
||||
connOptions.vWhitelistedRange.push_back(subnet);
|
||||
}
|
||||
|
||||
|
|
@ -1902,13 +1903,13 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
if (is_reject && offline_keys.size() > 0)
|
||||
valid_paklist = false;
|
||||
if (!valid_paklist)
|
||||
return InitError(_("ERROR: Invalid PAK entries given in conf file."));
|
||||
return InitError(_("ERROR: Invalid PAK entries given in conf file.").translated);
|
||||
if (is_reject || offline_keys.size() > 0) {
|
||||
CPAKList paklist;
|
||||
if(CPAKList::FromBytes(paklist, offline_keys, online_keys, is_reject)) {
|
||||
g_paklist_config = paklist;
|
||||
} else {
|
||||
return InitError(_("ERROR: Invalid PAK entries given in conf file."));
|
||||
return InitError(_("ERROR: Invalid PAK entries given in conf file.").translated);
|
||||
}
|
||||
} else {
|
||||
g_paklist_config = boost::none;
|
||||
|
|
@ -1923,7 +1924,7 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
if (CPAKList::FromBytes(paklist, offline_keys, online_keys, reject)) {
|
||||
g_paklist_blockchain = paklist;
|
||||
} else {
|
||||
return InitError(_("ERROR: Read invalid PAK list."));
|
||||
return InitError(_("ERROR: Read invalid PAK list.").translated);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1937,7 +1938,7 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
if (!MatchLiquidWatchman(fedpeg_script) &&
|
||||
fedpeg_script != CScript() << OP_TRUE &&
|
||||
!MatchMultisig(fedpeg_script, dummy_required, dummy_keys)) {
|
||||
return InitError(_("ERROR: Fedpegscript is not one of the accepted templates: OP_TRUE, CHECKMULTISIG, and Liquidv1"));
|
||||
return InitError(_("ERROR: Fedpegscript is not one of the accepted templates: OP_TRUE, CHECKMULTISIG, and Liquidv1").translated);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1946,11 +1947,11 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
SetRPCWarmupFinished();
|
||||
|
||||
// ELEMENTS:
|
||||
uiInterface.InitMessage(_("Awaiting mainchain RPC warmup"));
|
||||
uiInterface.InitMessage(_("Awaiting mainchain RPC warmup").translated);
|
||||
if (!MainchainRPCCheck(true)) { //Initial check, fail immediately
|
||||
return InitError(_("ERROR: elementsd is set to verify pegins but cannot get valid response from the mainchain daemon. Please check debug.log for more information.")
|
||||
return InitError(_("ERROR: elementsd is set to verify pegins but cannot get valid response from the mainchain daemon. Please check debug.log for more information.").translated
|
||||
+ "\n\n"
|
||||
+ strprintf(_("If you haven't setup a %s please get the latest stable version from %s or if you do not need to validate pegins set in your elements configuration %s"), "bitcoind", "https://bitcoincore.org/en/download/", "validatepegin=0"));
|
||||
+ strprintf(_("If you haven't setup a %s please get the latest stable version from %s or if you do not need to validate pegins set in your elements configuration %s"), "bitcoind", "https://bitcoincore.org/en/download/", "validatepegin=0").translated);
|
||||
}
|
||||
|
||||
// Start the lightweight block re-evaluation scheduler thread
|
||||
|
|
@ -1963,7 +1964,7 @@ bool AppInitMain(InitInterfaces& interfaces)
|
|||
reverification_scheduler.scheduleEvery(f2, check_rpc_every);
|
||||
}
|
||||
|
||||
uiInterface.InitMessage(_("Done loading"));
|
||||
uiInterface.InitMessage(_("Done loading").translated);
|
||||
|
||||
for (const auto& client : interfaces.chain_clients) {
|
||||
client->start(scheduler);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue