wallet_api: getPassword

This commit is contained in:
thotbot 2021-07-03 23:08:56 +02:00 committed by dsc
parent 39e16ffcf2
commit f34e643c18
3 changed files with 7 additions and 0 deletions

View File

@ -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();

View File

@ -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;

View File

@ -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;