diff --git a/src/keystore.cpp b/src/keystore.cpp index 08885a692..9f3edb7d2 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -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 diff --git a/src/zcash/address/unified.cpp b/src/zcash/address/unified.cpp index 46f3ef69c..2a99184ef 100644 --- a/src/zcash/address/unified.cpp +++ b/src/zcash/address/unified.cpp @@ -136,7 +136,6 @@ std::optional ZcashdUnifiedFullViewingKey::GetChangeAddress(co } }, [&](const SaplingChangeRequest& req) { - std::optional addr; // currently true by construction, as a UFVK must have a shielded component if (saplingKey.has_value()) { addr = saplingKey.value().GetChangeAddress();