aboutsummaryrefslogtreecommitdiff
path: root/src/mnemonics/electrum-words.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2021-03-05 12:57:21 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2021-03-06 10:26:15 +0000
commit064eeb286129d88bab60a81c08c319fbc91c5770 (patch)
treeae3902d678b1c7ab93b29b9524029d017e1aeccd /src/mnemonics/electrum-words.cpp
parentMerge pull request #7381 (diff)
downloadmonero-064eeb286129d88bab60a81c08c319fbc91c5770.tar.xz
wallet_rpc_server: set seed language in generate_from_keys
Also sanity check language name
Diffstat (limited to 'src/mnemonics/electrum-words.cpp')
-rw-r--r--src/mnemonics/electrum-words.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mnemonics/electrum-words.cpp b/src/mnemonics/electrum-words.cpp
index b6bc22a3d..8c79a53ca 100644
--- a/src/mnemonics/electrum-words.cpp
+++ b/src/mnemonics/electrum-words.cpp
@@ -491,6 +491,14 @@ namespace crypto
return "<language not found>";
}
+ bool is_valid_language(const std::string &language)
+ {
+ const std::vector<const Language::Base*> language_instances = get_language_list();
+ for (std::vector<const Language::Base*>::const_iterator it = language_instances.begin(); it != language_instances.end(); it++)
+ if ((*it)->get_english_language_name() == language || (*it)->get_language_name() == language)
+ return true;
+ return false;
+ }
}
}