From f717d5936c522b6be978b9bb3f88d2750658fa08 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 14 Dec 2019 21:15:02 +0000 Subject: 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. --- src/wallet/wallet2.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/wallet/wallet2.h') 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 m_encrypt_keys_after_refresh; + boost::mutex m_decrypt_keys_lock; + unsigned int m_decrypt_keys_lockers; bool m_unattended; bool m_devices_registered; -- cgit v1.2.3