Merge pull request #5615 from nuttycom/feature/wallet_orchard-merge_master

Merge master back to feature/wallet_orchard
This commit is contained in:
Kris Nuttycombe 2022-03-01 19:57:39 -07:00 committed by GitHub
commit 68d6c3ddc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -5865,6 +5865,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"))