diff options
| author | MarcoFalke <[email protected]> | 2019-08-19 18:12:35 -0400 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2020-05-01 07:39:00 -0400 |
| commit | fae51a5c6f4270a1088e6295b10a8cc45988ae46 (patch) | |
| tree | 1367e0780ab7e2fda2cb1cd46174029515d098f2 /src/interfaces/node.cpp | |
| parent | Merge #16426: Reverse cs_main, cs_wallet lock order and reduce cs_main locking (diff) | |
| download | discoin-fae51a5c6f4270a1088e6295b10a8cc45988ae46.tar.xz discoin-fae51a5c6f4270a1088e6295b10a8cc45988ae46.zip | |
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.
Diffstat (limited to 'src/interfaces/node.cpp')
| -rw-r--r-- | src/interfaces/node.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp index 5ebbd6158..8564819e6 100644 --- a/src/interfaces/node.cpp +++ b/src/interfaces/node.cpp @@ -43,8 +43,8 @@ class CWallet; fs::path GetWalletDir(); std::vector<fs::path> ListWalletDir(); std::vector<std::shared_ptr<CWallet>> GetWallets(); -std::shared_ptr<CWallet> LoadWallet(interfaces::Chain& chain, const std::string& name, std::string& error, std::vector<std::string>& warnings); -WalletCreationStatus CreateWallet(interfaces::Chain& chain, const SecureString& passphrase, uint64_t wallet_creation_flags, const std::string& name, std::string& error, std::vector<std::string>& warnings, std::shared_ptr<CWallet>& result); +std::shared_ptr<CWallet> LoadWallet(interfaces::Chain& chain, const std::string& name, bilingual_str& error, std::vector<bilingual_str>& warnings); +WalletCreationStatus CreateWallet(interfaces::Chain& chain, const SecureString& passphrase, uint64_t wallet_creation_flags, const std::string& name, bilingual_str& error, std::vector<bilingual_str>& warnings, std::shared_ptr<CWallet>& result); std::unique_ptr<interfaces::Handler> HandleLoadWallet(interfaces::Node::LoadWalletFn load_wallet); namespace interfaces { @@ -259,11 +259,11 @@ public: } return wallets; } - std::unique_ptr<Wallet> loadWallet(const std::string& name, std::string& error, std::vector<std::string>& warnings) override + std::unique_ptr<Wallet> loadWallet(const std::string& name, bilingual_str& error, std::vector<bilingual_str>& warnings) override { return MakeWallet(LoadWallet(*m_context.chain, name, error, warnings)); } - std::unique_ptr<Wallet> createWallet(const SecureString& passphrase, uint64_t wallet_creation_flags, const std::string& name, std::string& error, std::vector<std::string>& warnings, WalletCreationStatus& status) override + std::unique_ptr<Wallet> createWallet(const SecureString& passphrase, uint64_t wallet_creation_flags, const std::string& name, bilingual_str& error, std::vector<bilingual_str>& warnings, WalletCreationStatus& status) override { std::shared_ptr<CWallet> wallet; status = CreateWallet(*m_context.chain, passphrase, wallet_creation_flags, name, error, warnings, wallet); |