From 78e3ea51d6ece126e62874fe467e3064e2875435 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Fri, 4 Jun 2021 18:59:33 +0200 Subject: [PATCH] wallet_api: getPassword --- src/wallet/api/wallet.cpp | 2 +- src/wallet/api/wallet.h | 2 +- src/wallet/api/wallet2_api.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index 09cb8ecfa..03a86af28 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -855,7 +855,7 @@ bool WalletImpl::setPassword(const std::string &password) return status() == Status_Ok; } -std::string WalletImpl::getPassword() const +const std::string& WalletImpl::getPassword() const { return m_password; } diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h index a36dc1447..8a03f208e 100644 --- a/src/wallet/api/wallet.h +++ b/src/wallet/api/wallet.h @@ -96,7 +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; + const 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 81cfc36ac..9b34252ba 100644 --- a/src/wallet/api/wallet2_api.h +++ b/src/wallet/api/wallet2_api.h @@ -552,7 +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 const 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;