mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Merge #18922: gui: Do not translate InitWarning messages in debug.log
78be8d97d3d750fcfbbe509a72639b7b30b7bd18 util: Drop OpOriginal() and OpTranslated() (Hennadii Stepanov) da16f95c3fecf4ee1e9a1dc4333b0b92cd981afd gui: Do not translate InitWarning messages in debug.log (Hennadii Stepanov) 4c9b9a4882e68835f16a52f1f0657efe47e589b5 util: Enhance Join() (Hennadii Stepanov) fe05dd0611cfc2929a7fdec04ca5948bccf0233b util: Enhance bilingual_str (Hennadii Stepanov) Pull request description: This PR forces the `bitcoin-qt` to write `InitWarning()` messages to the `debug.log` file in untranslated form, i.e., in English. On master (376294cde6b1588cb17055d8fde567eaf5848c3c): ``` $ ./src/qt/bitcoin-qt -lang=nl -debug=vladidation -printtoconsole | grep 'vladi' Warning: Niet-ondersteunde logcategorie -debug=vladidation. 2020-05-09T12:39:59Z Warning: Niet-ondersteunde logcategorie -debug=vladidation. 2020-05-09T12:40:02Z Command-line arg: debug="vladidation" ``` With this PR: ``` $ ./src/qt/bitcoin-qt -lang=nl -debug=vladidation -printtoconsole | grep 'vladi' Warning: Unsupported logging category -debug=vladidation. 2020-05-09T12:42:04Z Warning: Unsupported logging category -debug=vladidation. 2020-05-09T12:42:35Z Command-line arg: debug="vladidation" ``` ![Screenshot from 2020-05-09 15-42-31](https://user-images.githubusercontent.com/32963518/81474073-c7a50e00-920b-11ea-8775-c41122dacafe.png) Related to #16218. ACKs for top commit: laanwj: ACK 78be8d97d3d750fcfbbe509a72639b7b30b7bd18 jonasschnelli: utACK 78be8d97d3d750fcfbbe509a72639b7b30b7bd18 MarcoFalke: ACK 78be8d97d3d750fcfbbe509a72639b7b30b7bd18 📢 Tree-SHA512: 48e9ecd23c4dd8ec262e3eb94f8e30944bcc9c6c163245fb837b2e0c484d4d0b4f47f7abc638c14edc27d635d340ba3ee4ba4506b062399e9cf59a1564c98755 # Conflicts: # src/wallet/load.cpp
This commit is contained in:
parent
af00598c9a
commit
b0de56db6a
@ -740,7 +740,7 @@ bool CCoinJoinClientManager::CheckAutomaticBackup()
|
||||
if (!mixingWallet.AutoBackupWallet("", errorString, warnings)) {
|
||||
if (!warnings.empty()) {
|
||||
// There were some issues saving backup but yet more or less safe to continue
|
||||
LogPrint(BCLog::COINJOIN, "CCoinJoinClientManager::CheckAutomaticBackup -- WARNING! Something went wrong on automatic backup: %s\n", Join(warnings, "\n", OpTranslated));
|
||||
LogPrint(BCLog::COINJOIN, "CCoinJoinClientManager::CheckAutomaticBackup -- WARNING! Something went wrong on automatic backup: %s\n", Join(warnings, Untranslated("\n")).translated);
|
||||
}
|
||||
if (!errorString.original.empty()) {
|
||||
// Things are really broken
|
||||
|
20
src/init.cpp
20
src/init.cpp
@ -1272,7 +1272,7 @@ bool AppInitParameterInteraction()
|
||||
|
||||
// Warn if unrecognized section name are present in the config file.
|
||||
for (const auto& section : gArgs.GetUnrecognizedSections()) {
|
||||
InitWarning(strprintf("%s:%i " + _("Section [%s] is not recognized.").translated, section.m_file, section.m_line, section.m_name));
|
||||
InitWarning(strprintf(Untranslated("%s:%i ") + _("Section [%s] is not recognized."), section.m_file, section.m_line, section.m_name));
|
||||
}
|
||||
|
||||
if (!fs::is_directory(GetBlocksDir())) {
|
||||
@ -1355,7 +1355,7 @@ bool AppInitParameterInteraction()
|
||||
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.").translated, nUserMaxConnections, nMaxConnections));
|
||||
InitWarning(strprintf(_("Reducing -maxconnections from %d to %d, because of system limitations."), nUserMaxConnections, nMaxConnections));
|
||||
|
||||
// ********************************************************* Step 3: parameter-to-internal-flags
|
||||
if (gArgs.IsArgSet("-debug")) {
|
||||
@ -1366,7 +1366,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.").translated, "-debug", cat));
|
||||
InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debug", cat));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1375,7 +1375,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.").translated, "-debugexclude", cat));
|
||||
InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debugexclude", cat));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1513,18 +1513,18 @@ bool AppInitParameterInteraction()
|
||||
const bool fRecoveryEnabled{llmq::CLLMQUtils::QuorumDataRecoveryEnabled()};
|
||||
const bool fQuorumVvecRequestsEnabled{llmq::CLLMQUtils::GetEnabledQuorumVvecSyncEntries().size() > 0};
|
||||
if (!fRecoveryEnabled && fQuorumVvecRequestsEnabled) {
|
||||
InitWarning("-llmq-qvvec-sync set but recovery is disabled due to -llmq-data-recovery=0");
|
||||
InitWarning(Untranslated("-llmq-qvvec-sync set but recovery is disabled due to -llmq-data-recovery=0"));
|
||||
}
|
||||
} catch (const std::invalid_argument& e) {
|
||||
return InitError(Untranslated(e.what()));
|
||||
}
|
||||
|
||||
if (gArgs.IsArgSet("-maxorphantx")) {
|
||||
InitWarning("-maxorphantx is not supported anymore. Use -maxorphantxsize instead.");
|
||||
InitWarning(Untranslated("-maxorphantx is not supported anymore. Use -maxorphantxsize instead."));
|
||||
}
|
||||
|
||||
if (gArgs.IsArgSet("-masternode")) {
|
||||
InitWarning(_("-masternode option is deprecated and ignored, specifying -masternodeblsprivkey is enough to start this node as a masternode.").translated);
|
||||
InitWarning(_("-masternode option is deprecated and ignored, specifying -masternodeblsprivkey is enough to start this node as a masternode."));
|
||||
}
|
||||
|
||||
if (gArgs.IsArgSet("-masternodeblsprivkey")) {
|
||||
@ -1549,7 +1549,7 @@ bool AppInitParameterInteraction()
|
||||
}
|
||||
|
||||
if (gArgs.IsArgSet("-litemode")) {
|
||||
InitWarning(_("-litemode is deprecated.").translated + (gArgs.GetBoolArg("-litemode", false) ? (" " + _("Its replacement -disablegovernance has been forced instead.").translated) : ( " " + _("It has been replaced by -disablegovernance.").translated)));
|
||||
InitWarning(strprintf(_("-litemode is deprecated.%s"), (gArgs.GetBoolArg("-litemode", false) ? (" " + _("Its replacement -disablegovernance has been forced instead.").translated) : ( " " + _("It has been replaced by -disablegovernance.").translated))));
|
||||
gArgs.ForceRemoveArg("-litemode");
|
||||
}
|
||||
|
||||
@ -1557,7 +1557,7 @@ bool AppInitParameterInteraction()
|
||||
LogPrintf("fDisableGovernance %d\n", fDisableGovernance);
|
||||
|
||||
if (fDisableGovernance) {
|
||||
InitWarning(_("You are starting with governance validation disabled.").translated + (fPruneMode ? " " + _("This is expected because you are running a pruned node.").translated : ""));
|
||||
InitWarning(strprintf(_("You are starting with governance validation disabled.%s"), (fPruneMode ? " " + _("This is expected because you are running a pruned node.").translated : "")));
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -1642,7 +1642,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").translated, config_file_path.string()));
|
||||
InitWarning(strprintf(_("The specified config file %s does not exist\n"), 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());
|
||||
|
@ -344,7 +344,7 @@ public:
|
||||
bool shutdownRequested() override { return ShutdownRequested(); }
|
||||
int64_t getAdjustedTime() override { return GetAdjustedTime(); }
|
||||
void initMessage(const std::string& message) override { ::uiInterface.InitMessage(message); }
|
||||
void initWarning(const std::string& message) override { InitWarning(message); }
|
||||
void initWarning(const bilingual_str& message) override { InitWarning(message); }
|
||||
void initError(const bilingual_str& message) override { InitError(message); }
|
||||
void loadWallet(std::unique_ptr<Wallet> wallet) override { ::uiInterface.LoadWallet(wallet); }
|
||||
void showProgress(const std::string& title, int progress, bool resume_possible) override
|
||||
|
@ -214,7 +214,7 @@ public:
|
||||
virtual void initMessage(const std::string& message) = 0;
|
||||
|
||||
//! Send init warning.
|
||||
virtual void initWarning(const std::string& message) = 0;
|
||||
virtual void initWarning(const bilingual_str& message) = 0;
|
||||
|
||||
//! Send init error.
|
||||
virtual void initError(const bilingual_str& message) = 0;
|
||||
|
@ -232,7 +232,7 @@ void CreateWalletActivity::finish()
|
||||
if (!m_error_message.original.empty()) {
|
||||
QMessageBox::critical(m_parent_widget, tr("Create wallet failed"), QString::fromStdString(m_error_message.translated));
|
||||
} else if (!m_warning_message.empty()) {
|
||||
QMessageBox::warning(m_parent_widget, tr("Create wallet warning"), QString::fromStdString(Join(m_warning_message, "\n", OpTranslated)));
|
||||
QMessageBox::warning(m_parent_widget, tr("Create wallet warning"), QString::fromStdString(Join(m_warning_message, Untranslated("\n")).translated));
|
||||
}
|
||||
|
||||
if (m_wallet_model) Q_EMIT created(m_wallet_model);
|
||||
@ -273,7 +273,7 @@ void OpenWalletActivity::finish()
|
||||
if (!m_error_message.original.empty()) {
|
||||
QMessageBox::critical(m_parent_widget, tr("Open wallet failed"), QString::fromStdString(m_error_message.translated));
|
||||
} else if (!m_warning_message.empty()) {
|
||||
QMessageBox::warning(m_parent_widget, tr("Open wallet warning"), QString::fromStdString(Join(m_warning_message, "\n", OpTranslated)));
|
||||
QMessageBox::warning(m_parent_widget, tr("Open wallet warning"), QString::fromStdString(Join(m_warning_message, Untranslated("\n")).translated));
|
||||
}
|
||||
|
||||
if (m_wallet_model) Q_EMIT opened(m_wallet_model);
|
||||
|
@ -433,7 +433,7 @@ bool WalletModel::autoBackupWallet(QString& strBackupWarningRet, QString& strBac
|
||||
bilingual_str strBackupError;
|
||||
std::vector<bilingual_str> warnings;
|
||||
bool result = m_wallet->autoBackupWallet("", strBackupError, warnings);
|
||||
strBackupWarningRet = QString::fromStdString(Join(warnings, "\n", OpTranslated));
|
||||
strBackupWarningRet = QString::fromStdString(Join(warnings, Untranslated("\n")).translated);
|
||||
strBackupErrorRet = QString::fromStdString(strBackupError.translated);
|
||||
return result;
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ bool InitError(const bilingual_str& str)
|
||||
return false;
|
||||
}
|
||||
|
||||
void InitWarning(const std::string& str)
|
||||
void InitWarning(const bilingual_str& str)
|
||||
{
|
||||
uiInterface.ThreadSafeMessageBox(Untranslated(str), "", CClientUIInterface::MSG_WARNING);
|
||||
uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING);
|
||||
}
|
||||
|
@ -138,8 +138,7 @@ public:
|
||||
};
|
||||
|
||||
/** Show warning message **/
|
||||
// TODO: InitWarning() should take a bilingual_str parameter.
|
||||
void InitWarning(const std::string& str);
|
||||
void InitWarning(const bilingual_str& str);
|
||||
|
||||
/** Show error message **/
|
||||
bool InitError(const bilingual_str& str);
|
||||
|
@ -17,21 +17,23 @@
|
||||
struct bilingual_str {
|
||||
std::string original;
|
||||
std::string translated;
|
||||
|
||||
bilingual_str& operator+=(const bilingual_str& rhs)
|
||||
{
|
||||
original += rhs.original;
|
||||
translated += rhs.translated;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
inline bilingual_str operator+(const bilingual_str& lhs, const bilingual_str& rhs)
|
||||
inline bilingual_str operator+(bilingual_str lhs, const bilingual_str& rhs)
|
||||
{
|
||||
return bilingual_str{
|
||||
lhs.original + rhs.original,
|
||||
lhs.translated + rhs.translated};
|
||||
lhs += rhs;
|
||||
return lhs;
|
||||
}
|
||||
|
||||
/** Mark a bilingual_str as untranslated */
|
||||
inline bilingual_str Untranslated(std::string original) { return {original, original}; }
|
||||
/** Unary operator to return the original */
|
||||
inline std::string OpOriginal(const bilingual_str& b) { return b.original; }
|
||||
/** Unary operator to return the translation */
|
||||
inline std::string OpTranslated(const bilingual_str& b) { return b.translated; }
|
||||
|
||||
namespace tinyformat {
|
||||
template <typename... Args>
|
||||
|
@ -130,7 +130,7 @@ bool WalletInit::ParameterInteraction() const
|
||||
int rescan_mode = gArgs.GetArg("-rescan", 0);
|
||||
if (rescan_mode < 0 || rescan_mode > 2) {
|
||||
LogPrintf("%s: Warning: incorrect -rescan mode, falling back to default value.\n", __func__);
|
||||
InitWarning(_("Incorrect -rescan mode, falling back to default value").translated);
|
||||
InitWarning(_("Incorrect -rescan mode, falling back to default value"));
|
||||
gArgs.ForceRemoveArg("-rescan");
|
||||
}
|
||||
|
||||
@ -147,13 +147,13 @@ bool WalletInit::ParameterInteraction() const
|
||||
|
||||
if (gArgs.IsArgSet("-walletbackupsdir")) {
|
||||
if (!fs::is_directory(gArgs.GetArg("-walletbackupsdir", ""))) {
|
||||
InitWarning(strprintf(_("Warning: incorrect parameter %s, path must exist! Using default path.").translated, "-walletbackupsdir"));
|
||||
InitWarning(strprintf(_("Warning: incorrect parameter %s, path must exist! Using default path."), "-walletbackupsdir"));
|
||||
gArgs.ForceRemoveArg("-walletbackupsdir");
|
||||
}
|
||||
}
|
||||
|
||||
if (gArgs.IsArgSet("-hdseed") && IsHex(gArgs.GetArg("-hdseed", "not hex")) && (gArgs.IsArgSet("-mnemonic") || gArgs.IsArgSet("-mnemonicpassphrase"))) {
|
||||
InitWarning(strprintf(_("Warning: can't use %s and %s together, will prefer %s").translated, "-hdseed", "-mnemonic/-mnemonicpassphrase", "-hdseed"));
|
||||
InitWarning(strprintf(_("Warning: can't use %s and %s together, will prefer %s"), "-hdseed", "-mnemonic/-mnemonicpassphrase", "-hdseed"));
|
||||
gArgs.ForceRemoveArg("-mnemonic");
|
||||
gArgs.ForceRemoveArg("-mnemonicpassphrase");
|
||||
}
|
||||
@ -161,7 +161,7 @@ bool WalletInit::ParameterInteraction() const
|
||||
// begin PrivateSend -> CoinJoin migration
|
||||
if (gArgs.IsArgSet("-privatesendrounds")) {
|
||||
int nRoundsDeprecated = gArgs.GetArg("-privatesendrounds", DEFAULT_COINJOIN_ROUNDS);
|
||||
InitWarning(strprintf(_("Warning: %s is deprecated, please use %s instead").translated, "-privatesendrounds", "-coinjoinrounds"));
|
||||
InitWarning(strprintf(_("Warning: %s is deprecated, please use %s instead"), "-privatesendrounds", "-coinjoinrounds"));
|
||||
if (gArgs.SoftSetArg("-coinjoinrounds", itostr(nRoundsDeprecated))) {
|
||||
LogPrintf("%s: parameter interaction: -privatesendrounds=%d -> setting -coinjoinrounds=%d\n", __func__, nRoundsDeprecated, nRoundsDeprecated);
|
||||
}
|
||||
@ -169,7 +169,7 @@ bool WalletInit::ParameterInteraction() const
|
||||
}
|
||||
if (gArgs.IsArgSet("-privatesendamount")) {
|
||||
int nAmountDeprecated = gArgs.GetArg("-privatesendamount", DEFAULT_COINJOIN_AMOUNT);
|
||||
InitWarning(strprintf(_("Warning: %s is deprecated, please use %s instead").translated, "-privatesendamount", "-coinjoinamount"));
|
||||
InitWarning(strprintf(_("Warning: %s is deprecated, please use %s instead"), "-privatesendamount", "-coinjoinamount"));
|
||||
if (gArgs.SoftSetArg("-coinjoinamount", itostr(nAmountDeprecated))) {
|
||||
LogPrintf("%s: parameter interaction: -privatesendamount=%d -> setting -coinjoinamount=%d\n", __func__, nAmountDeprecated, nAmountDeprecated);
|
||||
}
|
||||
@ -177,7 +177,7 @@ bool WalletInit::ParameterInteraction() const
|
||||
}
|
||||
if (gArgs.IsArgSet("-privatesenddenomsgoal")) {
|
||||
int nDenomsGoalDeprecated = gArgs.GetArg("-privatesenddenomsgoal", DEFAULT_COINJOIN_DENOMS_GOAL);
|
||||
InitWarning(strprintf(_("Warning: %s is deprecated, please use %s instead").translated, "-privatesenddenomsgoal", "-coinjoindenomsgoal"));
|
||||
InitWarning(strprintf(_("Warning: %s is deprecated, please use %s instead"), "-privatesenddenomsgoal", "-coinjoindenomsgoal"));
|
||||
if (gArgs.SoftSetArg("-coinjoindenomsgoal", itostr(nDenomsGoalDeprecated))) {
|
||||
LogPrintf("%s: parameter interaction: -privatesenddenomsgoal=%d -> setting -coinjoindenomsgoal=%d\n", __func__, nDenomsGoalDeprecated, nDenomsGoalDeprecated);
|
||||
}
|
||||
@ -185,7 +185,7 @@ bool WalletInit::ParameterInteraction() const
|
||||
}
|
||||
if (gArgs.IsArgSet("-privatesenddenomshardcap")) {
|
||||
int nDenomsHardcapDeprecated = gArgs.GetArg("-privatesenddenomshardcap", DEFAULT_COINJOIN_DENOMS_HARDCAP);
|
||||
InitWarning(strprintf(_("Warning: %s is deprecated, please use %s instead").translated, "-privatesenddenomshardcap", "-coinjoindenomshardcap"));
|
||||
InitWarning(strprintf(_("Warning: %s is deprecated, please use %s instead"), "-privatesenddenomshardcap", "-coinjoindenomshardcap"));
|
||||
if (gArgs.SoftSetArg("-coinjoindenomshardcap", itostr(nDenomsHardcapDeprecated))) {
|
||||
LogPrintf("%s: parameter interaction: -privatesenddenomshardcap=%d -> setting -coinjoindenomshardcap=%d\n", __func__, nDenomsHardcapDeprecated, nDenomsHardcapDeprecated);
|
||||
}
|
||||
@ -193,7 +193,7 @@ bool WalletInit::ParameterInteraction() const
|
||||
}
|
||||
if (gArgs.IsArgSet("-privatesendsessions")) {
|
||||
int nSessionsDeprecated = gArgs.GetArg("-privatesendsessions", DEFAULT_COINJOIN_SESSIONS);
|
||||
InitWarning(strprintf(_("Warning: %s is deprecated, please use %s instead").translated, "-privatesendsessions", "-coinjoinsessions"));
|
||||
InitWarning(strprintf(_("Warning: %s is deprecated, please use %s instead"), "-privatesendsessions", "-coinjoinsessions"));
|
||||
if (gArgs.SoftSetArg("-coinjoinsessions", itostr(nSessionsDeprecated))) {
|
||||
LogPrintf("%s: parameter interaction: -privatesendsessions=%d -> setting -coinjoinsessions=%d\n", __func__, nSessionsDeprecated, nSessionsDeprecated);
|
||||
}
|
||||
@ -201,7 +201,7 @@ bool WalletInit::ParameterInteraction() const
|
||||
}
|
||||
if (gArgs.IsArgSet("-enableprivatesend")) {
|
||||
bool fEnablePSDeprecated = gArgs.GetBoolArg("-enableprivatesend", 0);
|
||||
InitWarning(strprintf(_("Warning: %s is deprecated, please use %s instead").translated, "-enableprivatesend", "-enablecoinjoin"));
|
||||
InitWarning(strprintf(_("Warning: %s is deprecated, please use %s instead"), "-enableprivatesend", "-enablecoinjoin"));
|
||||
if (gArgs.SoftSetBoolArg("-enablecoinjoin", fEnablePSDeprecated)) {
|
||||
LogPrintf("%s: parameter interaction: -enableprivatesend=%d -> setting -enablecoinjoin=%d\n", __func__, fEnablePSDeprecated, fEnablePSDeprecated);
|
||||
}
|
||||
@ -209,7 +209,7 @@ bool WalletInit::ParameterInteraction() const
|
||||
}
|
||||
if (gArgs.IsArgSet("-privatesendautostart")) {
|
||||
bool fAutoStartDeprecated = gArgs.GetBoolArg("-privatesendautostart", DEFAULT_COINJOIN_AUTOSTART);
|
||||
InitWarning(strprintf(_("Warning: %s is deprecated, please use %s instead").translated, "-privatesendautostart", "-coinjoinautostart"));
|
||||
InitWarning(strprintf(_("Warning: %s is deprecated, please use %s instead"), "-privatesendautostart", "-coinjoinautostart"));
|
||||
if (gArgs.SoftSetBoolArg("-coinjoinautostart", fAutoStartDeprecated)) {
|
||||
LogPrintf("%s: parameter interaction: -privatesendautostart=%d -> setting -coinjoinautostart=%d\n", __func__, fAutoStartDeprecated, fAutoStartDeprecated);
|
||||
}
|
||||
@ -217,7 +217,7 @@ bool WalletInit::ParameterInteraction() const
|
||||
}
|
||||
if (gArgs.IsArgSet("-privatesendmultisession")) {
|
||||
bool fMultiSessionDeprecated = gArgs.GetBoolArg("-privatesendmultisession", DEFAULT_COINJOIN_MULTISESSION);
|
||||
InitWarning(strprintf(_("Warning: %s is deprecated, please use %s instead").translated, "-privatesendmultisession", "-coinjoinmultisession"));
|
||||
InitWarning(strprintf(_("Warning: %s is deprecated, please use %s instead"), "-privatesendmultisession", "-coinjoinmultisession"));
|
||||
if (gArgs.SoftSetBoolArg("-coinjoinmultisession", fMultiSessionDeprecated)) {
|
||||
LogPrintf("%s: parameter interaction: -privatesendmultisession=%d -> setting -coinjoinmultisession=%d\n", __func__, fMultiSessionDeprecated, fMultiSessionDeprecated);
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ bool VerifyWallets(interfaces::Chain& chain, const std::vector<std::string>& wal
|
||||
bilingual_str error_string;
|
||||
std::vector<bilingual_str> warnings;
|
||||
bool verify_success = CWallet::Verify(chain, location, error_string, warnings);
|
||||
if (!warnings.empty()) chain.initWarning(Join(warnings, "\n", OpTranslated));
|
||||
if (!warnings.empty()) chain.initWarning(Join(warnings, Untranslated("\n")));
|
||||
if (!verify_success) {
|
||||
chain.initError(error_string);
|
||||
return false;
|
||||
@ -70,7 +70,7 @@ bool LoadWallets(interfaces::Chain& chain, const std::vector<std::string>& walle
|
||||
bilingual_str error_string;
|
||||
std::vector<bilingual_str> warnings;
|
||||
std::shared_ptr<CWallet> pwallet = CWallet::CreateWalletFromFile(chain, WalletLocation(walletFile), error_string, warnings);
|
||||
if (!warnings.empty()) chain.initWarning(Join(warnings, "\n", OpTranslated));
|
||||
if (!warnings.empty()) chain.initWarning(Join(warnings, Untranslated("\n")));
|
||||
if (!pwallet) {
|
||||
chain.initError(error_string);
|
||||
return false;
|
||||
|
@ -2733,7 +2733,7 @@ static UniValue loadwallet(const JSONRPCRequest& request)
|
||||
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
obj.pushKV("name", wallet->GetName());
|
||||
obj.pushKV("warning", Join(warnings, "\n", OpOriginal));
|
||||
obj.pushKV("warning", Join(warnings, Untranslated("\n")).original);
|
||||
|
||||
return obj;
|
||||
}
|
||||
@ -2800,7 +2800,7 @@ static UniValue createwallet(const JSONRPCRequest& request)
|
||||
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
obj.pushKV("name", wallet->GetName());
|
||||
obj.pushKV("warning", Join(warnings, "\n", OpOriginal));
|
||||
obj.pushKV("warning", Join(warnings, Untranslated("\n")).original);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
@ -5497,7 +5497,7 @@ bool CWallet::AutoBackupWallet(const fs::path& wallet_path, bilingual_str& error
|
||||
backupFile.make_preferred();
|
||||
if (!BackupWallet(backupFile.string())) {
|
||||
warnings.push_back(strprintf(_("Failed to create backup %s!"), backupFile.string()));
|
||||
WalletLogPrintf("%s\n", Join(warnings, "\n", OpTranslated));
|
||||
WalletLogPrintf("%s\n", Join(warnings, Untranslated("\n")).translated);
|
||||
nWalletBackups = -1;
|
||||
return false;
|
||||
}
|
||||
@ -5507,7 +5507,7 @@ bool CWallet::AutoBackupWallet(const fs::path& wallet_path, bilingual_str& error
|
||||
WalletLogPrintf("nKeysLeftSinceAutoBackup: %d\n", nKeysLeftSinceAutoBackup);
|
||||
if (IsLocked(true)) {
|
||||
warnings.push_back(_("Wallet is locked, can't replenish keypool! Automatic backups and mixing are disabled, please unlock your wallet to replenish keypool."));
|
||||
WalletLogPrintf("%s\n", Join(warnings, "\n", OpTranslated));
|
||||
WalletLogPrintf("%s\n", Join(warnings, Untranslated("\n")).translated);
|
||||
nWalletBackups = -2;
|
||||
return false;
|
||||
}
|
||||
@ -5522,7 +5522,7 @@ bool CWallet::AutoBackupWallet(const fs::path& wallet_path, bilingual_str& error
|
||||
if (fs::exists(backupFile))
|
||||
{
|
||||
warnings.push_back(_("Failed to create backup, file already exists! This could happen if you restarted wallet in less than 60 seconds. You can continue if you are ok with this."));
|
||||
WalletLogPrintf("%s\n", Join(warnings, "\n", OpTranslated));
|
||||
WalletLogPrintf("%s\n", Join(warnings, Untranslated("\n")).translated);
|
||||
return false;
|
||||
}
|
||||
if(fs::exists(sourceFile)) {
|
||||
@ -5531,7 +5531,7 @@ bool CWallet::AutoBackupWallet(const fs::path& wallet_path, bilingual_str& error
|
||||
WalletLogPrintf("Creating backup of %s -> %s\n", sourceFile.string(), backupFile.string());
|
||||
} catch(fs::filesystem_error &error) {
|
||||
warnings.push_back(strprintf(_("Failed to create backup, error: %s"), fsbridge::get_filesystem_error_message(error)));
|
||||
WalletLogPrintf("%s\n", Join(warnings, "\n", OpTranslated));
|
||||
WalletLogPrintf("%s\n", Join(warnings, Untranslated("\n")).translated);
|
||||
nWalletBackups = -1;
|
||||
return false;
|
||||
}
|
||||
@ -5570,7 +5570,7 @@ bool CWallet::AutoBackupWallet(const fs::path& wallet_path, bilingual_str& error
|
||||
WalletLogPrintf("Old backup deleted: %s\n", file.second);
|
||||
} catch(fs::filesystem_error &error) {
|
||||
warnings.push_back(strprintf(_("Failed to delete backup, error: %s"), fsbridge::get_filesystem_error_message(error)));
|
||||
WalletLogPrintf("%s\n", Join(warnings, "\n", OpTranslated));
|
||||
WalletLogPrintf("%s\n", Join(warnings, Untranslated("\n")).translated);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user