aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-12-04 22:02:40 +0200
committerRiccardo Spagni <ric@spagni.net>2016-12-04 22:02:40 +0200
commit3d533d10379156b557bcc387d9d736ef076433d1 (patch)
tree61989b6652ede908c128e4c13e35acbb206fb574
parentMerge pull request #1379 (diff)
parentwallet: add a getter for the filename path (diff)
downloadmonero-3d533d10379156b557bcc387d9d736ef076433d1.tar.xz
Merge pull request #1380
657a70e0 wallet: add a getter for the filename path (moneromooo-monero)
-rw-r--r--src/wallet/api/wallet.cpp5
-rw-r--r--src/wallet/api/wallet.h1
-rw-r--r--src/wallet/wallet2.cpp5
-rw-r--r--src/wallet/wallet2.h2
-rw-r--r--src/wallet/wallet2_api.h1
5 files changed, 14 insertions, 0 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index 8514abfcd..97aaf2785 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -399,6 +399,11 @@ std::string WalletImpl::integratedAddress(const std::string &payment_id) const
return m_wallet->get_account().get_public_integrated_address_str(pid, m_wallet->testnet());
}
+std::string WalletImpl::path() const
+{
+ return m_wallet->path();
+}
+
bool WalletImpl::store(const std::string &path)
{
clearStatus();
diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h
index 02a46da8c..5e4a64ff8 100644
--- a/src/wallet/api/wallet.h
+++ b/src/wallet/api/wallet.h
@@ -64,6 +64,7 @@ public:
bool setPassword(const std::string &password);
std::string address() const;
std::string integratedAddress(const std::string &payment_id) const;
+ std::string path() const;
bool store(const std::string &path);
std::string filename() const;
std::string keysFilename() const;
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index a5444ec14..a15233a87 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -2353,6 +2353,11 @@ void wallet2::check_genesis(const crypto::hash& genesis_hash) const {
THROW_WALLET_EXCEPTION_IF(genesis_hash != m_blockchain[0], error::wallet_internal_error, what);
}
//----------------------------------------------------------------------------------------------------
+std::string wallet2::path() const
+{
+ return m_wallet_file;
+}
+//----------------------------------------------------------------------------------------------------
void wallet2::store()
{
store_to("", "");
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h
index 1c8b9f858..f62a0f15b 100644
--- a/src/wallet/wallet2.h
+++ b/src/wallet/wallet2.h
@@ -332,6 +332,8 @@ namespace tools
*/
void store_to(const std::string &path, const std::string &password);
+ std::string path() const;
+
/*!
* \brief verifies given password is correct for default wallet keys file
*/
diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h
index e624ffa69..cc6c5a337 100644
--- a/src/wallet/wallet2_api.h
+++ b/src/wallet/wallet2_api.h
@@ -195,6 +195,7 @@ struct Wallet
virtual std::string errorString() const = 0;
virtual bool setPassword(const std::string &password) = 0;
virtual std::string address() const = 0;
+ virtual std::string path() const = 0;
/*!
* \brief integratedAddress - returns integrated address for current wallet address and given payment_id.