aboutsummaryrefslogtreecommitdiff
path: root/src/simplewallet/simplewallet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/simplewallet/simplewallet.cpp')
-rw-r--r--src/simplewallet/simplewallet.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index cc7b7138b..7d28de9c0 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -1010,6 +1010,7 @@ bool simple_wallet::generate_from_json(const boost::program_options::variables_m
m_wallet.reset(new tools::wallet2(testnet));
m_wallet->callback(this);
+ m_wallet->set_refresh_from_block_height(field_scan_from_height);
try
{
@@ -1055,8 +1056,6 @@ bool simple_wallet::generate_from_json(const boost::program_options::variables_m
return false;
}
- m_wallet->set_refresh_from_block_height(field_scan_from_height);
-
wallet_file = m_wallet_file;
return r;
@@ -1175,7 +1174,7 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
return false;
}
}
- if (!m_restore_height)
+ if (!m_restore_height && m_generate_new.empty())
{
std::string heightstr = command_line::input_line("Restore from specific blockchain height (optional, default 0): ");
if (std::cin.eof())
@@ -1451,6 +1450,16 @@ bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string
m_wallet->callback(this);
m_wallet->set_seed_language(mnemonic_language);
+ // for a totally new account, we don't care about older blocks.
+ if (!m_generate_new.empty())
+ {
+ std::string err;
+ m_wallet->set_refresh_from_block_height(get_daemon_blockchain_height(err));
+ } else if (m_restore_height)
+ {
+ m_wallet->set_refresh_from_block_height(m_restore_height);
+ }
+
crypto::secret_key recovery_val;
try
{
@@ -1466,15 +1475,6 @@ bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string
}
m_wallet->init(m_daemon_address);
- // for a totally new account, we don't care about older blocks.
- if (!m_restore_deterministic_wallet)
- {
- std::string err;
- m_wallet->set_refresh_from_block_height(get_daemon_blockchain_height(err));
- } else if (m_restore_height)
- {
- m_wallet->set_refresh_from_block_height(m_restore_height);
- }
// convert rng value to electrum-style word list
std::string electrum_words;
@@ -1507,6 +1507,8 @@ bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string
m_wallet.reset(new tools::wallet2(testnet));
m_wallet->callback(this);
+ if (m_restore_height)
+ m_wallet->set_refresh_from_block_height(m_restore_height);
try
{
@@ -1522,7 +1524,6 @@ bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string
}
m_wallet->init(m_daemon_address);
- m_wallet->set_refresh_from_block_height(m_restore_height);
return true;
}
@@ -1534,6 +1535,8 @@ bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string
m_wallet.reset(new tools::wallet2(testnet));
m_wallet->callback(this);
+ if (m_restore_height)
+ m_wallet->set_refresh_from_block_height(m_restore_height);
try
{
@@ -1548,7 +1551,6 @@ bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string
}
m_wallet->init(m_daemon_address);
- m_wallet->set_refresh_from_block_height(m_restore_height);
return true;
}