mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-10 12:43:30 +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:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <fs.h>
|
||||
#include <util/system.h>
|
||||
#include <util/translation.h>
|
||||
#include <wallet/wallet.h>
|
||||
#include <wallet/walletutil.h>
|
||||
|
||||
@@ -117,7 +118,7 @@ bool ExecuteWalletToolFunc(const std::string& command, const std::string& name)
|
||||
tfm::format(std::cerr, "Error: no wallet file at %s\n", name);
|
||||
return false;
|
||||
}
|
||||
std::string error;
|
||||
bilingual_str error;
|
||||
if (!WalletBatch::VerifyEnvironment(path, error)) {
|
||||
tfm::format(std::cerr, "Error loading %s. Is wallet being used by other process?\n", name);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user