mirror of
https://github.com/monero-project/monero.git
synced 2026-01-07 02:04:02 -08:00
Merge pull request #827
f1e70d1Only log 1/N skipped blocks (Howard Chu)cebb97cMove refresh height to keys file from cache file (Howard Chu)590c439Make fast_refresh interruptible (Howard Chu)687855dSet refresh height earlier (Howard Chu)2fb00c0Fix19fe8ae3ef(Howard Chu)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user