diff options
author | stoffu <stoffu@protonmail.ch> | 2018-07-03 11:33:11 +0900 |
---|---|---|
committer | stoffu <stoffu@protonmail.ch> | 2018-07-03 18:07:20 +0900 |
commit | a4272de79746c2349a0da8371f45390989cc6b90 (patch) | |
tree | 6778bc6bcc9fe3447bd9d34a9768d891e248e291 /src/wallet/api/wallet2_api.h | |
parent | Merge pull request #4067 (diff) | |
download | monero-a4272de79746c2349a0da8371f45390989cc6b90.tar.xz |
wallet2: unlock keys file before calling verify_password (needed for Windows)
Also added notes to WalletManager::verifyWalletPassword (which afaik seems unused
by anyone at the moment) regarding the need to unlock the keys file beforehand.
Diffstat (limited to 'src/wallet/api/wallet2_api.h')
-rw-r--r-- | src/wallet/api/wallet2_api.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wallet/api/wallet2_api.h b/src/wallet/api/wallet2_api.h index f54255e91..0cd0ff5cf 100644 --- a/src/wallet/api/wallet2_api.h +++ b/src/wallet/api/wallet2_api.h @@ -900,6 +900,12 @@ struct Wallet //! Initiates a light wallet import wallet request virtual bool lightWalletImportWalletRequest(std::string &payment_id, uint64_t &fee, bool &new_request, bool &request_fulfilled, std::string &payment_address, std::string &status) = 0; + + //! locks/unlocks the keys file; returns true on success + virtual bool lockKeysFile() = 0; + virtual bool unlockKeysFile() = 0; + //! returns true if the keys file is locked + virtual bool isKeysFileLocked() = 0; }; /** @@ -1070,6 +1076,10 @@ struct WalletManager * @param password - password to verify * @param no_spend_key - verify only view keys? * @return - true if password is correct + * + * @note + * This function will fail when the wallet keys file is opened because the wallet program locks the keys file. + * In this case, Wallet::unlockKeysFile() and Wallet::lockKeysFile() need to be called before and after the call to this function, respectively. */ virtual bool verifyWalletPassword(const std::string &keys_file_name, const std::string &password, bool no_spend_key) const = 0; |