mirror of
https://github.com/wownero/wownero-cpp.git
synced 2026-10-17 15:21:30 +02:00
keys wallet only set language if spend key given
This commit is contained in:
@@ -179,12 +179,14 @@ namespace monero {
|
||||
|
||||
// initialize remaining wallet
|
||||
wallet->m_network_type = network_type;
|
||||
wallet->m_language = language;
|
||||
epee::wipeable_string wipeable_mnemonic;
|
||||
if (!crypto::ElectrumWords::bytes_to_words(spend_key_sk, wipeable_mnemonic, wallet->m_language)) {
|
||||
throw runtime_error("Failed to create mnemonic from private spend key for language: " + string(wallet->m_language));
|
||||
if (!spend_key.empty()) {
|
||||
wallet->m_language = language;
|
||||
epee::wipeable_string wipeable_mnemonic;
|
||||
if (!crypto::ElectrumWords::bytes_to_words(spend_key_sk, wipeable_mnemonic, wallet->m_language)) {
|
||||
throw runtime_error("Failed to create mnemonic from private spend key for language: " + string(wallet->m_language));
|
||||
}
|
||||
wallet->m_mnemonic = string(wipeable_mnemonic.data(), wipeable_mnemonic.size());
|
||||
}
|
||||
wallet->m_mnemonic = string(wipeable_mnemonic.data(), wipeable_mnemonic.size());
|
||||
wallet->init_common();
|
||||
|
||||
return wallet;
|
||||
|
||||
Reference in New Issue
Block a user