From d2644c15c34a9a9b95aa3051ebbfdd259dced3f3 Mon Sep 17 00:00:00 2001 From: luigi1111 Date: Tue, 9 Aug 2016 17:46:49 -0500 Subject: fix restore-deterministic height Simplewallet improperly skipped the restore from height code if restoring a deterministic wallet AND not specifying a wallet file in the command line. The other generate options require a wallet file as an argument, which prevents "ask_wallet_create_if_needed()" from being called, which in turn causes "m_generate_new" to remain unset. Specifying a wallet file at launch with --restore-deterministic emulated this behavior. --- src/simplewallet/simplewallet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/simplewallet/simplewallet.cpp') diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index a3a4685b5..2d2de89b0 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -1259,7 +1259,7 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm) return false; } } - if (!m_restore_height && m_generate_new.empty()) + if (!m_restore_height && (m_generate_new.empty() || m_restore_deterministic_wallet)) { std::string heightstr = command_line::input_line("Restore from specific blockchain height (optional, default 0): "); if (std::cin.eof()) @@ -1546,7 +1546,7 @@ bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string m_wallet->set_seed_language(mnemonic_language); // for a totally new account, we don't care about older blocks. - if (!m_generate_new.empty()) + if (!m_generate_new.empty() && !m_restore_deterministic_wallet) { std::string err; m_wallet->set_refresh_from_block_height(get_daemon_blockchain_height(err)); -- cgit v1.2.3