wallet: Avoid translating RPC errors when loading wallets

Common errors and warnings should be translated when displayed in the
GUI, but not translated when displayed elsewhere. The wallet method
CreateWalletFromFile does not know its caller, so this commit changes it
to return a bilingual_str to the caller.
This commit is contained in:
MarcoFalke
2019-08-19 18:12:35 -04:00
parent 608359b071
commit fae51a5c6f
18 changed files with 149 additions and 121 deletions

View File

@@ -377,10 +377,9 @@ bool LegacyScriptPubKeyMan::CanGetAddresses(bool internal) const
return keypool_has_keys;
}
bool LegacyScriptPubKeyMan::Upgrade(int prev_version, std::string& error)
bool LegacyScriptPubKeyMan::Upgrade(int prev_version, bilingual_str& error)
{
LOCK(cs_KeyStore);
error = "";
bool hd_upgrade = false;
bool split_upgrade = false;
if (m_storage.CanSupportFeature(FEATURE_HD) && !IsHDEnabled()) {
@@ -405,7 +404,7 @@ bool LegacyScriptPubKeyMan::Upgrade(int prev_version, std::string& error)
// Regenerate the keypool if upgraded to HD
if (hd_upgrade) {
if (!TopUp()) {
error = _("Unable to generate keys").translated;
error = _("Unable to generate keys");
return false;
}
}