Introduce CWallet::HaveOrchardSpendingKeyForAddress.

This commit is contained in:
therealyingtong 2022-04-06 20:34:38 +08:00
parent 9e80e4aff6
commit 8a7283ca83
2 changed files with 7 additions and 1 deletions

View File

@ -6716,7 +6716,7 @@ bool CWallet::HasSpendingKeys(const NoteFilter& addrSet) const {
}
for (const auto& addr : addrSet.GetOrchardAddresses()) {
if (!orchardWallet.GetSpendingKeyForAddress(addr).has_value()) {
if (!HaveOrchardSpendingKeyForAddress(addr)) {
return false;
}
}
@ -6724,6 +6724,10 @@ bool CWallet::HasSpendingKeys(const NoteFilter& addrSet) const {
return true;
}
bool CWallet::HaveOrchardSpendingKeyForAddress(
const OrchardRawAddress &addr) const {
return orchardWallet.GetSpendingKeyForAddress(addr).has_value();
}
/**
* Find notes in the wallet filtered by payment addresses, min depth, max depth,

View File

@ -1957,6 +1957,8 @@ public:
*/
bool HasSpendingKeys(const NoteFilter& noteFilter) const;
bool HaveOrchardSpendingKeyForAddress(const libzcash::OrchardRawAddress &addr) const;
/* Find notes filtered by payment addresses, min depth, max depth, if they are spent,
if a spending key is required, and if they are locked */
void GetFilteredNotes(std::vector<SproutNoteEntry>& sproutEntriesRet,