aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIlya Kitaev <mbg033@gmail.com>2016-03-31 15:39:28 +0300
committerIlya Kitaev <mbg033@gmail.com>2016-06-23 15:49:36 +0300
commit9cdf0b7d7fce2a5cd6cc62d6187e85be66e5b14c (patch)
tree7918c23613fd971d7203b62df210d892def28106 /src
parenttestnet option, Wallet::balance(), Wallet::unlockedBalance() (diff)
downloadmonero-9cdf0b7d7fce2a5cd6cc62d6187e85be66e5b14c.tar.xz
"testnet" is default parameter
Diffstat (limited to 'src')
-rw-r--r--src/wallet/wallet2_api.cpp11
-rw-r--r--src/wallet/wallet2_api.h3
2 files changed, 11 insertions, 3 deletions
diff --git a/src/wallet/wallet2_api.cpp b/src/wallet/wallet2_api.cpp
index 3c7dffa26..faf2778d3 100644
--- a/src/wallet/wallet2_api.cpp
+++ b/src/wallet/wallet2_api.cpp
@@ -31,6 +31,7 @@
#include "wallet2_api.h"
#include "wallet2.h"
#include "mnemonics/electrum-words.h"
+#include "cryptonote_core/cryptonote_format_utils.h"
#include <memory>
namespace epee {
@@ -71,9 +72,11 @@ public:
std::string address() const;
bool store(const std::string &path);
bool init(const std::string &daemon_address, uint64_t upper_transaction_size_limit);
+ bool connectToDaemon();
uint64_t balance() const;
uint64_t unlockedBalance() const;
- bool connectToDaemon();
+ std::string displayAmount(uint64_t amount) const;
+
private:
void clearStatus();
@@ -285,6 +288,11 @@ uint64_t WalletImpl::unlockedBalance() const
return m_wallet->unlocked_balance();
}
+std::string WalletImpl::displayAmount(uint64_t amount) const
+{
+ return cryptonote::print_money(amount);
+}
+
bool WalletImpl::connectToDaemon()
{
bool result = m_wallet->check_connection();
@@ -387,4 +395,5 @@ WalletManager *WalletManagerFactory::getWalletManager()
return g_walletManager;
}
+
}
diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h
index ec37358d4..a56043e9e 100644
--- a/src/wallet/wallet2_api.h
+++ b/src/wallet/wallet2_api.h
@@ -71,6 +71,7 @@ struct Wallet
virtual bool connectToDaemon() = 0;
virtual uint64_t balance() const = 0;
virtual uint64_t unlockedBalance() const = 0;
+ virtual std::string displayAmount(uint64_t amount) const = 0;
// TODO?
// virtual uint64_t unlockedDustBalance() const = 0;
};
@@ -119,8 +120,6 @@ struct WalletManager
virtual std::string errorString() const = 0;
// //! set
// virtual void setDaemonAddress(const std::string &address) = 0;
-
-
};