Use Bip44TransparentAccountKeyPath() for Bip44AccountChains keypath construction.

This commit is contained in:
Kris Nuttycombe 2021-12-30 11:24:26 -07:00
parent 16ba83ab1e
commit 8d6d178a47
1 changed files with 2 additions and 10 deletions

View File

@ -50,11 +50,7 @@ std::optional<std::pair<CKey, HDKeyPath>> libzcash::Bip44AccountChains::DeriveEx
auto childKey = external.Derive(addrIndex);
if (!childKey.has_value()) return std::nullopt;
auto hdKeypath = "m/44'/"
+ std::to_string(bip44CoinType) + "'/"
+ std::to_string(accountId) + "'/"
+ "0/"
+ std::to_string(addrIndex);
auto hdKeypath = Bip44TransparentAccountKeyPath(bip44CoinType, accountId) + "/0/" + std::to_string(addrIndex);
return std::make_pair(childKey.value().key, hdKeypath);
}
@ -63,11 +59,7 @@ std::optional<std::pair<CKey, HDKeyPath>> libzcash::Bip44AccountChains::DeriveIn
auto childKey = internal.Derive(addrIndex);
if (!childKey.has_value()) return std::nullopt;
auto hdKeypath = "m/44'/"
+ std::to_string(bip44CoinType) + "'/"
+ std::to_string(accountId) + "'/"
+ "1/"
+ std::to_string(addrIndex);
auto hdKeypath = Bip44TransparentAccountKeyPath(bip44CoinType, accountId) + "/1/" + std::to_string(addrIndex);
return std::make_pair(childKey.value().key, hdKeypath);
}