From e4273f24153ca5222ab0af6ea6d84b7761e31f05 Mon Sep 17 00:00:00 2001 From: Jakob Lind Date: Fri, 1 Aug 2014 10:17:50 +0200 Subject: #36 simplewallet refresh include optional height param height param is used optionally in refresh command TODO: This should also be the default behaviour when generating a new wallet. --- src/simplewallet/simplewallet.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/simplewallet') diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index f2693b2d0..4bb5389e4 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -622,12 +622,25 @@ bool simple_wallet::refresh(const std::vector& args) return true; message_writer() << "Starting refresh..."; + size_t fetched_blocks = 0; + size_t start_height = 0; + if(!args.empty()){ + try + { + start_height = boost::lexical_cast( args[0] ); + } + catch(const boost::bad_lexical_cast &) + { + start_height = 0; + } + } + bool ok = false; std::ostringstream ss; try { - m_wallet->refresh(fetched_blocks); + m_wallet->refresh(start_height, fetched_blocks); ok = true; // Clear line "Height xxx of xxx" std::cout << "\r \r"; -- cgit v1.2.3