aboutsummaryrefslogtreecommitdiff
path: root/src/simplewallet/simplewallet.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-12-02 09:25:53 +0200
committerRiccardo Spagni <ric@spagni.net>2017-12-02 09:25:53 +0200
commit81fb8320821d23ac0d4fb7a9be2ef9477562d2a4 (patch)
tree86dc193f529e69f59256fdd995cab9b00ca97e8c /src/simplewallet/simplewallet.cpp
parentMerge pull request #2854 (diff)
parentFixes #759 Add sanity check on restore height (diff)
downloadmonero-81fb8320821d23ac0d4fb7a9be2ef9477562d2a4.tar.xz
Merge pull request #2833
b0426d4c Fixes #759 Add sanity check on restore height (Cifrado)
Diffstat (limited to 'src/simplewallet/simplewallet.cpp')
-rw-r--r--src/simplewallet/simplewallet.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index 9a42f9547..a307f9d3d 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -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
{