From 19fcc74912b48791665ea0e81c9ded91180ab6c5 Mon Sep 17 00:00:00 2001 From: Ilya Kitaev Date: Sat, 12 Mar 2016 17:52:58 +0300 Subject: Wallet::address implemented --- src/wallet/wallet2_api.cpp | 6 ++++++ src/wallet/wallet2_api.h | 1 + 2 files changed, 7 insertions(+) (limited to 'src/wallet') diff --git a/src/wallet/wallet2_api.cpp b/src/wallet/wallet2_api.cpp index 645bc9c46..6428e7b32 100644 --- a/src/wallet/wallet2_api.cpp +++ b/src/wallet/wallet2_api.cpp @@ -68,6 +68,7 @@ public: int status() const; std::string errorString() const; bool setPassword(const std::string &password); + std::string address() const; private: void clearStatus(); @@ -233,6 +234,11 @@ bool WalletImpl::setPassword(const std::string &password) return result; } +std::string WalletImpl::address() const +{ + return m_wallet->get_account().get_public_address_str(m_wallet->testnet()); +} + void WalletImpl::clearStatus() { m_status = Status_Ok; diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h index d8a0e8419..7a22a88de 100644 --- a/src/wallet/wallet2_api.h +++ b/src/wallet/wallet2_api.h @@ -65,6 +65,7 @@ struct Wallet //! in case error status, returns error string virtual std::string errorString() const = 0; virtual bool setPassword(const std::string &password) = 0; + virtual std::string address() const = 0; }; /** -- cgit v1.2.3