mirror of
https://github.com/wownero/wownero-cpp.git
synced 2026-10-23 10:08:33 +02:00
don't set default restore height for random wallet
This commit is contained in:
@@ -1079,19 +1079,20 @@ namespace monero {
|
||||
if (config.m_seed_offset == boost::none) config_normalized.m_seed_offset = std::string("");
|
||||
if (config.m_account_lookahead != boost::none && config.m_subaddress_lookahead == boost::none) throw std::runtime_error("No subaddress lookahead provided with account lookahead");
|
||||
if (config.m_account_lookahead == boost::none && config.m_subaddress_lookahead != boost::none) throw std::runtime_error("No account lookahead provided with subaddress lookahead");
|
||||
if (config.m_restore_height == boost::none) config_normalized.m_restore_height = 0;
|
||||
|
||||
// create wallet
|
||||
if (!config_normalized.m_mnemonic.get().empty()) {
|
||||
if (config.m_restore_height == boost::none) config_normalized.m_restore_height = 0;
|
||||
if (!config_normalized.m_language.get().empty()) throw std::runtime_error("Cannot specify language when creating wallet from mnemonic");
|
||||
return create_wallet_from_mnemonic(config_normalized, std::move(http_client_factory));
|
||||
} else if (!config_normalized.m_primary_address.get().empty() || !config_normalized.m_private_spend_key.get().empty()) {
|
||||
if (config.m_restore_height == boost::none) config_normalized.m_restore_height = 0;
|
||||
if (!config_normalized.m_seed_offset.get().empty()) throw std::runtime_error("Cannot specify seed offset when creating wallet from keys");
|
||||
if (config_normalized.m_language.get().empty()) config_normalized.m_language = std::string("English");
|
||||
if (!monero_utils::is_valid_language(config_normalized.m_language.get())) throw std::runtime_error("Unknown language: " + config_normalized.m_language.get());
|
||||
return create_wallet_from_keys(config_normalized, std::move(http_client_factory));
|
||||
} else {
|
||||
if (!config_normalized.m_seed_offset.get().empty()) throw std::runtime_error("Cannot specify seed offset when creating wallet from keys");
|
||||
if (!config_normalized.m_seed_offset.get().empty()) throw std::runtime_error("Cannot specify seed offset when creating random wallet");
|
||||
if (config_normalized.m_restore_height != boost::none) throw std::runtime_error("Cannot specify restore height when creating random wallet");
|
||||
if (config_normalized.m_language.get().empty()) config_normalized.m_language = std::string("English");
|
||||
if (!monero_utils::is_valid_language(config_normalized.m_language.get())) throw std::runtime_error("Unknown language: " + config_normalized.m_language.get());
|
||||
|
||||
Reference in New Issue
Block a user