aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2_api.cpp
diff options
context:
space:
mode:
authorIlya Kitaev <mbg033@gmail.com>2016-03-31 16:38:57 +0300
committerIlya Kitaev <mbg033@gmail.com>2016-06-23 15:49:36 +0300
commite04c67ac4c8a686832e7a1136a8f32465a0e0956 (patch)
tree7b9bb32488be78c79d82a35cb7548d6a254d8435 /src/wallet/wallet2_api.cpp
parent"testnet" is default parameter (diff)
downloadmonero-e04c67ac4c8a686832e7a1136a8f32465a0e0956.tar.xz
Wallet::refresh + tests
Diffstat (limited to 'src/wallet/wallet2_api.cpp')
-rw-r--r--src/wallet/wallet2_api.cpp13
1 files changed, 13 insertions, 0 deletions
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();