aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet_rpc_server.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-04-06 15:59:10 +0200
committerRiccardo Spagni <ric@spagni.net>2019-04-06 15:59:10 +0200
commit7e5651c346f06c0d727b10d0e167cd9c08443d46 (patch)
tree52e033953767a4ea1b400044c08e3e47e321e268 /src/wallet/wallet_rpc_server.cpp
parentMerge pull request #5344 (diff)
parentwallet_rpc_server: allow english/local language names in create_wallet (diff)
downloadmonero-7e5651c346f06c0d727b10d0e167cd9c08443d46.tar.xz
Merge pull request #5345
678262ab wallet_rpc_server: allow english/local language names in create_wallet (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
-rw-r--r--src/wallet/wallet_rpc_server.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index e79b1a686..92265d954 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -2916,7 +2916,8 @@ namespace tools
//------------------------------------------------------------------------------------------------------------------------------
bool wallet_rpc_server::on_get_languages(const wallet_rpc::COMMAND_RPC_GET_LANGUAGES::request& req, wallet_rpc::COMMAND_RPC_GET_LANGUAGES::response& res, epee::json_rpc::error& er, const connection_context *ctx)
{
- crypto::ElectrumWords::get_language_list(res.languages);
+ crypto::ElectrumWords::get_language_list(res.languages, true);
+ crypto::ElectrumWords::get_language_list(res.languages_local, false);
return true;
}
//------------------------------------------------------------------------------------------------------------------------------
@@ -2947,14 +2948,19 @@ namespace tools
std::string wallet_file = req.filename.empty() ? "" : (m_wallet_dir + "/" + req.filename);
{
std::vector<std::string> languages;
- crypto::ElectrumWords::get_language_list(languages);
+ crypto::ElectrumWords::get_language_list(languages, false);
std::vector<std::string>::iterator it;
it = std::find(languages.begin(), languages.end(), req.language);
if (it == languages.end())
{
+ crypto::ElectrumWords::get_language_list(languages, true);
+ it = std::find(languages.begin(), languages.end(), req.language);
+ }
+ if (it == languages.end())
+ {
er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR;
- er.message = "Unknown language";
+ er.message = "Unknown language: " + req.language;
return false;
}
}