aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.h
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2020-04-29 10:45:12 +0100
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2020-05-07 01:42:07 +0100
commit9f59dde9740d065118bdddde75ef9f4e4603a7b1 (patch)
tree5b3a7997c0dd3cf6f564fdae529f047c69aa7de3 /src/wallet/wallet.h
parenta2e6db5c4f1bb52a8814102b628e51652493d06a (diff)
downloadbitcoin-9f59dde9740d065118bdddde75ef9f4e4603a7b1.tar.xz
rpc: Relock wallet only if most recent callback
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r--src/wallet/wallet.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index 24c78fceb3..e05973799c 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -869,8 +869,10 @@ public:
std::vector<std::string> GetDestValues(const std::string& prefix) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
//! Holds a timestamp at which point the wallet is scheduled (externally) to be relocked. Caller must arrange for actual relocking to occur via Lock().
- int64_t nRelockTime = 0;
+ int64_t nRelockTime GUARDED_BY(cs_wallet){0};
+ // Used to prevent concurrent calls to walletpassphrase RPC.
+ Mutex m_unlock_mutex;
bool Unlock(const SecureString& strWalletPassphrase, bool accept_no_keys = false);
bool ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase, const SecureString& strNewWalletPassphrase);
bool EncryptWallet(const SecureString& strWalletPassphrase);