From 830c19c934f1c621cf8f268772d5ab92f35d75b3 Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Thu, 31 Mar 2016 16:38:57 +0300 Subject: Wallet::refresh + tests --- src/wallet/wallet2_api.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/wallet/wallet2_api.cpp') diff --git a/src/wallet/wallet2_api.cpp b/src/wallet/wallet2_api.cpp index faf2778d3..e6ed249cc 100644 --- a/src/wallet/wallet2_api.cpp +++ b/src/wallet/wallet2_api.cpp @@ -76,6 +76,7 @@ public: uint64_t balance() const; uint64_t unlockedBalance() const; std::string displayAmount(uint64_t amount) const; + bool refresh(); private: @@ -293,6 +294,18 @@ std::string WalletImpl::displayAmount(uint64_t amount) const return cryptonote::print_money(amount); } +bool WalletImpl::refresh() +{ + clearStatus(); + try { + m_wallet->refresh(); + } catch (const std::exception &e) { + m_status = Status_Error; + m_errorString = e.what(); + } + return m_status == Status_Ok; +} + bool WalletImpl::connectToDaemon() { bool result = m_wallet->check_connection(); -- cgit v1.2.3