Merge pull request #5604 from nuttycom/fix_missing_wallet_lock
GenerateNewKey must be guarded by a cs_wallet lock
This commit is contained in:
commit
18f443db1c
|
@ -5719,6 +5719,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"))
|
||||
|
|
Loading…
Reference in New Issue