Merge 6663c802fe into merged_master (Bitcoin PR bitcoin/bitcoin#25634)

This commit is contained in:
Byron Hambly 2025-06-27 14:40:19 +02:00
commit c8c3ee099d
5 changed files with 184 additions and 2 deletions

View file

@ -762,12 +762,12 @@ bool LegacyScriptPubKeyMan::AddKeyPubKeyWithDB(WalletBatch& batch, const CKey& s
RemoveWatchOnly(script);
}
m_storage.UnsetBlankWalletFlag(batch);
if (!m_storage.HasEncryptionKeys()) {
return batch.WriteKey(pubkey,
secret.GetPrivKey(),
mapKeyMetadata[pubkey.GetID()]);
}
m_storage.UnsetBlankWalletFlag(batch);
return true;
}