diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 6f1cc9c2e..e3411c580 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -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, diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 1122b2990..05f241905 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -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& sproutEntriesRet,