Fix variable shadowing in change address derivation & add change IVK to the keystore.

This commit is contained in:
Kris Nuttycombe 2022-01-30 11:15:50 -07:00
parent acacc044fc
commit ae2213dcdc
2 changed files with 2 additions and 1 deletions

View File

@ -313,6 +313,8 @@ bool CBasicKeyStore::AddUnifiedFullViewingKey(
if (saplingKey.has_value()) {
auto ivk = saplingKey.value().fvk.in_viewing_key();
mapSaplingKeyUnified.insert(std::make_pair(ivk, ufvk.GetKeyID()));
auto changeIvk = saplingKey.value().GetInternalDFVK().fvk.in_viewing_key();
mapSaplingKeyUnified.insert(std::make_pair(changeIvk, ufvk.GetKeyID()));
}
// We can't reasonably add the transparent component here, because

View File

@ -136,7 +136,6 @@ std::optional<RecipientAddress> ZcashdUnifiedFullViewingKey::GetChangeAddress(co
}
},
[&](const SaplingChangeRequest& req) {
std::optional<RecipientAddress> addr;
// currently true by construction, as a UFVK must have a shielded component
if (saplingKey.has_value()) {
addr = saplingKey.value().GetChangeAddress();