Merge remote-tracking branch 'upstream/master' into feature/wallet_orchard-merge_master

This commit is contained in:
Kris Nuttycombe 2022-03-01 16:54:05 -07:00
commit 783e269a7b
1 changed files with 2 additions and 0 deletions

View File

@ -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"))