mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user