aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-12-25 21:21:00 +0200
committerRiccardo Spagni <ric@spagni.net>2017-12-25 21:21:00 +0200
commit409e9bb0299d7be59a8168e7eace847f60024216 (patch)
tree4770a04eb9be75fa1eb5470495e8eaa5713fde21 /src
parentMerge pull request #2930 (diff)
parentwallet2: error out in get_seed if the language is invalid (diff)
downloadmonero-409e9bb0299d7be59a8168e7eace847f60024216.tar.xz
Merge pull request #2931
04349492 wallet2: error out in get_seed if the language is invalid (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/wallet/wallet2.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 78553708b..8f5f15f9c 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -715,7 +715,11 @@ bool wallet2::get_seed(std::string& electrum_words, const epee::wipeable_string
crypto::secret_key key = get_account().get_keys().m_spend_secret_key;
if (!passphrase.empty())
key = cryptonote::encrypt_key(key, passphrase);
- crypto::ElectrumWords::bytes_to_words(key, electrum_words, seed_language);
+ if (!crypto::ElectrumWords::bytes_to_words(key, electrum_words, seed_language))
+ {
+ std::cout << "Failed to create seed from key for language: " << seed_language << std::endl;
+ return false;
+ }
return true;
}