diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 6341c425d..a5977e9d7 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -5864,6 +5864,8 @@ bool CWallet::InitLoadWallet(const CChainParams& params, bool clearWitnessCaches { // Create new keyUser and set as default key if (!walletInstance->IsCrypted()) { + LOCK(walletInstance->cs_wallet); + CPubKey newDefaultKey = walletInstance->GenerateNewKey(true); walletInstance->SetDefaultKey(newDefaultKey); if (!walletInstance->SetAddressBook(walletInstance->vchDefaultKey.GetID(), "", "receive"))