diff options
author | Jakob Lind <karl.jakob.lind@gmail.com> | 2014-08-01 10:17:50 +0200 |
---|---|---|
committer | Jakob Lind <karl.jakob.lind@gmail.com> | 2014-08-01 10:17:50 +0200 |
commit | e4273f24153ca5222ab0af6ea6d84b7761e31f05 (patch) | |
tree | 30c2413ec7c761d9326d6131bcbcbb0bc61dcb5a /src/simplewallet | |
parent | Merge pull request #72 from fluffypony/master (diff) | |
download | monero-e4273f24153ca5222ab0af6ea6d84b7761e31f05.tar.xz |
#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.
Diffstat (limited to 'src/simplewallet')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
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<std::string>& 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<int>( 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"; |