diff options
| author | Cifrado <hello@cifrado.me> | 2017-11-17 00:00:06 +0100 |
|---|---|---|
| committer | Cifrado <hello@cifrado.me> | 2017-11-17 08:35:59 +0100 |
| commit | b0426d4cf28ca4780157cac433a61ccba84fa4c0 (patch) | |
| tree | 8d5e2d6549f59fa05d3e8445647b67e582430661 /src/simplewallet/simplewallet.cpp | |
| parent | dc6a8014bdbde26468751b89a289d45b73095e51 (diff) | |
| download | monzero-core-b0426d4cf28ca4780157cac433a61ccba84fa4c0.tar.gz monzero-core-b0426d4cf28ca4780157cac433a61ccba84fa4c0.tar.xz monzero-core-b0426d4cf28ca4780157cac433a61ccba84fa4c0.zip | |
Fixes #759 Add sanity check on restore height
Diffstat (limited to 'src/simplewallet/simplewallet.cpp')
| -rw-r--r-- | src/simplewallet/simplewallet.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 37db00bc1..4f25a6c4a 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -1588,7 +1588,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 { |
