Only maintain CKeyID for the transparent part of ZcashdUnifiedAddress

This commit is contained in:
Kris Nuttycombe 2021-11-07 11:26:28 -05:00
parent cfee863644
commit 0fe1134337
2 changed files with 4 additions and 4 deletions

View File

@ -355,7 +355,7 @@ std::optional<ZcashdUnifiedAddress> ZcashdUnifiedFullViewingKey::Address(diversi
CExtPubKey childKey;
if (changeKey.Derive(childKey, childIndex.value())) {
ua.transparentKey = childKey.pubkey;
ua.transparentAddress = childKey.pubkey.GetID();
} else {
return std::nullopt;
}

View File

@ -314,15 +314,15 @@ class ZcashdUnifiedFullViewingKey;
class ZcashdUnifiedAddress {
private:
diversifier_index_t diversifier_index;
std::optional<CPubKey> transparentKey; //TODO: should this just be the public key hash?
std::optional<CKeyID> transparentAddress;
std::optional<SaplingPaymentAddress> saplingAddress;
friend class ZcashdUnifiedFullViewingKey;
ZcashdUnifiedAddress() {}
public:
const std::optional<CPubKey>& GetTransparentKey() const {
return transparentKey;
const std::optional<CKeyID>& GetTransparentAddress() const {
return transparentAddress;
}
const std::optional<SaplingPaymentAddress>& GetSaplingPaymentAddress() const {