mirror of
https://github.com/monero-project/monero.git
synced 2025-08-03 02:46:12 -04:00
Wallet::refresh + tests
This commit is contained in:
parent
9cdf0b7d7f
commit
e04c67ac4c
3 changed files with 28 additions and 0 deletions
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue