From f34e643c1852781279e9a60e0c6ed8da0899090c Mon Sep 17 00:00:00 2001 From: thotbot Date: Sat, 3 Jul 2021 23:08:56 +0200 Subject: [PATCH] wallet_api: getPassword --- src/wallet/api/wallet.cpp | 5 +++++ src/wallet/api/wallet.h | 1 + src/wallet/api/wallet2_api.h | 1 + 3 files changed, 7 insertions(+) diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index 561017741..d054c6391 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -859,6 +859,11 @@ bool WalletImpl::setPassword(const std::string &password) return status() == Status_Ok; } +std::string WalletImpl::getPassword() const +{ + return m_password; +} + bool WalletImpl::setDevicePin(const std::string &pin) { clearStatus(); diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h index 6fa129cd9..cf2044d89 100644 --- a/src/wallet/api/wallet.h +++ b/src/wallet/api/wallet.h @@ -96,6 +96,7 @@ public: std::string errorString() const override; void statusWithErrorString(int& status, std::string& errorString) const override; bool setPassword(const std::string &password) override; + std::string getPassword() const override; bool setDevicePin(const std::string &password) override; bool setDevicePassphrase(const std::string &password) override; std::string address(uint32_t accountIndex = 0, uint32_t addressIndex = 0) const override; diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h index 1e601347f..d29b26a25 100644 --- a/src/wallet/api/wallet2_api.h +++ b/src/wallet/api/wallet2_api.h @@ -552,6 +552,7 @@ struct Wallet //! returns both error and error string atomically. suggested to use in instead of status() and errorString() virtual void statusWithErrorString(int& status, std::string& errorString) const = 0; virtual bool setPassword(const std::string &password) = 0; + virtual std::string getPassword() const = 0; virtual bool setDevicePin(const std::string &pin) { (void)pin; return false; }; virtual bool setDevicePassphrase(const std::string &passphrase) { (void)passphrase; return false; }; virtual std::string address(uint32_t accountIndex = 0, uint32_t addressIndex = 0) const = 0;