Skip to content

Commit c626dcb

Browse files
committed
Make fUseCrypto atomic
1 parent 731065b commit c626dcb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/wallet/crypter.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include "serialize.h"
1010
#include "support/allocators/secure.h"
1111

12+
#include <atomic>
13+
1214
const unsigned int WALLET_CRYPTO_KEY_SIZE = 32;
1315
const unsigned int WALLET_CRYPTO_SALT_SIZE = 8;
1416
const unsigned int WALLET_CRYPTO_IV_SIZE = 16;
@@ -118,7 +120,7 @@ class CCryptoKeyStore : public CBasicKeyStore
118120

119121
//! if fUseCrypto is true, mapKeys must be empty
120122
//! if fUseCrypto is false, vMasterKey must be empty
121-
bool fUseCrypto;
123+
std::atomic<bool> fUseCrypto;
122124

123125
//! keeps track of whether Unlock has run a thorough check before
124126
bool fDecryptionThoroughlyChecked;

0 commit comments

Comments
 (0)