Create CWallet::IsSaplingNullifierFromMe()

This commit is contained in:
Simon
2018-07-30 17:09:13 -07:00
parent 037cacf2ce
commit d7cf640bbf
2 changed files with 19 additions and 0 deletions

View File

@@ -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<JSOutPoint> notes,
std::vector<boost::optional<SproutWitness>>& 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;
}