aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-12-14 21:15:02 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-12-17 01:38:29 +0000
commitf717d5936c522b6be978b9bb3f88d2750658fa08 (patch)
tree3acf82feb974625ef1c484cacf2333fb28b6f522 /src/wallet/wallet2.h
parentMerge pull request #6057 (diff)
downloadmonero-f717d5936c522b6be978b9bb3f88d2750658fa08.tar.xz
wallet2: guard against race with multiple decrypt_keys users
If more than one thread wants to make sure of the spend secret key, then we decrypt on the first caller and reencrypt on the last caller, otherwise we could use an invalid secret key.
Diffstat (limited to 'src/wallet/wallet2.h')
-rw-r--r--src/wallet/wallet2.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h
index b6f72c7e1..aecfd6ba3 100644
--- a/src/wallet/wallet2.h
+++ b/src/wallet/wallet2.h
@@ -1613,6 +1613,8 @@ private:
crypto::chacha_key m_cache_key;
boost::optional<epee::wipeable_string> m_encrypt_keys_after_refresh;
+ boost::mutex m_decrypt_keys_lock;
+ unsigned int m_decrypt_keys_lockers;
bool m_unattended;
bool m_devices_registered;