diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index a6b55f10605..36595a907f4 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1566,6 +1566,18 @@ bool CWallet::IsSproutNullifierFromMe(const uint256& nullifier) const return false; } +bool CWallet::IsSaplingNullifierFromMe(const uint256& nullifier) const +{ + { + LOCK(cs_wallet); + if (mapSaplingNullifiersToNotes.count(nullifier) && + mapWallet.count(mapSaplingNullifiersToNotes.at(nullifier).hash)) { + return true; + } + } + return false; +} + void CWallet::GetSproutNoteWitnesses(std::vector notes, std::vector>& witnesses, uint256 &final_anchor) @@ -1712,6 +1724,11 @@ bool CWallet::IsFromMe(const CTransaction& tx) const } } } + for (const SpendDescription &spend : tx.vShieldedSpend) { + if (IsSaplingNullifierFromMe(spend.nullifier)) { + return true; + } + } return false; } diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index aec720073f8..d020357a2e0 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -1099,6 +1099,8 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface mapSproutNoteData_t FindMySproutNotes(const CTransaction& tx) const; mapSaplingNoteData_t FindMySaplingNotes(const CTransaction& tx) const; bool IsSproutNullifierFromMe(const uint256& nullifier) const; + bool IsSaplingNullifierFromMe(const uint256& nullifier) const; + void GetSproutNoteWitnesses( std::vector notes, std::vector>& witnesses,