aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIlya Kitaev <mbg033@gmail.com>2016-03-31 16:38:57 +0300
committerIlya Kitaev <mbg033@gmail.com>2016-03-31 16:38:57 +0300
commit830c19c934f1c621cf8f268772d5ab92f35d75b3 (patch)
treead1e603ce35b064d9559a96846f1898ac924ed7c /src
parent"testnet" is default parameter (diff)
downloadmonero-830c19c934f1c621cf8f268772d5ab92f35d75b3.tar.xz
Wallet::refresh + tests
Diffstat (limited to 'src')
-rw-r--r--src/wallet/wallet2_api.cpp13
-rw-r--r--src/wallet/wallet2_api.h3
2 files changed, 16 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();
diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h
index a56043e9e..c818608ed 100644
--- a/src/wallet/wallet2_api.h
+++ b/src/wallet/wallet2_api.h
@@ -74,6 +74,9 @@ struct Wallet
virtual std::string displayAmount(uint64_t amount) const = 0;
// TODO?
// virtual uint64_t unlockedDustBalance() const = 0;
+ // TODO refresh
+ virtual bool refresh() = 0;
+ // TODO transfer
};
/**