Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
This commit is contained in:
parent
2ec7073459
commit
92445ba0a5
|
@ -7,7 +7,7 @@ Notable changes
|
|||
Mnemonic Recovery Phrases
|
||||
-------------------------
|
||||
|
||||
The zcashd wallet has been modified to support ZIP 339 (derived from BIP 39)
|
||||
The zcashd wallet has been modified to support ZIP 339 (to be compatible with BIP 39)
|
||||
which describes how to derive the wallet's HD seed from a mnemonic phrase.
|
||||
The mnemonic phrase will be generated on load of the wallet, or the first time
|
||||
the wallet is unlocked, and is available via the `z_exportwallet` RPC call. All
|
||||
|
|
|
@ -1754,7 +1754,7 @@ UniValue walletconfirmbackup(const UniValue& params, bool fHelp)
|
|||
" of the data returned by z_exportwallet. An error will be returned if the value provided\n"
|
||||
" does not match the wallet's existing emergency recovery phrase.\n"
|
||||
"\nExamples:\n"
|
||||
+ HelpExampleCli("walletconfirmbackup", "\"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art\"")
|
||||
+ HelpExampleRpc("walletconfirmbackup", "\"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art\"")
|
||||
);
|
||||
|
||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||
|
|
|
@ -260,7 +260,7 @@ std::pair<SaplingExtendedSpendingKey, HDKeyPath> SaplingExtendedSpendingKey::For
|
|||
// Derive m/32'/coin_type'
|
||||
auto m_32h_cth = m_32h.Derive(bip44CoinType | HARDENED_KEY_LIMIT);
|
||||
|
||||
// Derive account key at next index, skip keys already known to the wallet
|
||||
// Derive account key at the given account index
|
||||
auto xsk = m_32h_cth.Derive(accountId | HARDENED_KEY_LIMIT);
|
||||
|
||||
// Create new metadata
|
||||
|
@ -348,13 +348,13 @@ std::optional<ZcashdUnifiedAddress> ZcashdUnifiedFullViewingKey::Address(diversi
|
|||
auto childIndex = j.ToTransparentChildIndex();
|
||||
if (!childIndex.has_value()) return std::nullopt;
|
||||
|
||||
CExtPubKey changeKey;
|
||||
if (!transparentKey.value().Derive(changeKey, 0)) {
|
||||
CExtPubKey externalKey;
|
||||
if (!transparentKey.value().Derive(externalKey, 0)) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
CExtPubKey childKey;
|
||||
if (changeKey.Derive(childKey, childIndex.value())) {
|
||||
if (externalKey.Derive(childKey, childIndex.value())) {
|
||||
ua.transparentAddress = childKey.pubkey.GetID();
|
||||
} else {
|
||||
return std::nullopt;
|
||||
|
|
Loading…
Reference in New Issue