aboutsummaryrefslogtreecommitdiff
path: root/src/simplewallet/simplewallet.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-05-17 19:04:41 +0200
committerRiccardo Spagni <ric@spagni.net>2016-05-17 19:04:41 +0200
commitae205020f6f17f12b75a69240c4fcbbee72d30af (patch)
tree66a868fbd6c98b3ba48665f3b8126bcf318286a6 /src/simplewallet/simplewallet.cpp
parentMerge branch 'performance' of https://github.com/LMDB/bitmonero (diff)
parentOnly log 1/N skipped blocks (diff)
downloadmonero-ae205020f6f17f12b75a69240c4fcbbee72d30af.tar.xz
Merge pull request #827
f1e70d1 Only log 1/N skipped blocks (Howard Chu) cebb97c Move refresh height to keys file from cache file (Howard Chu) 590c439 Make fast_refresh interruptible (Howard Chu) 687855d Set refresh height earlier (Howard Chu) 2fb00c0 Fix 19fe8ae3ef1aa46ae8fdd4e4d6862510390ddab7 (Howard Chu)
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;
}