Merge pull request #2833

b0426d4c Fixes #759 Add sanity check on restore height (Cifrado)
This commit is contained in:
Riccardo Spagni 2017-12-02 09:25:53 +02:00
commit 81fb832082
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
3 changed files with 44 additions and 20 deletions

View file

@ -1801,7 +1801,17 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
}
}
if (m_restoring)
{
uint64_t estimate_height = m_wallet->estimate_blockchain_height();
if (m_restore_height >= estimate_height)
{
success_msg_writer() << tr("Restore height ") << m_restore_height << (" is not yet reached. The current estimated height is ") << estimate_height;
std::string confirm = input_line(tr("Still apply restore height? (Y/Yes/N/No): "));
if (std::cin.eof() || command_line::is_no(confirm))
m_restore_height = 0;
}
m_wallet->set_refresh_from_block_height(m_restore_height);
}
}
else
{