Add methods to store SaplingOutPoint in setLockedSaplingNotes

This commit is contained in:
Simon
2018-08-29 11:41:03 -07:00
parent 0f62cacf0c
commit b1c693e532
2 changed files with 37 additions and 1 deletions

View File

@@ -3858,6 +3858,37 @@ std::vector<JSOutPoint> CWallet::ListLockedSproutNotes()
return vOutpts;
}
void CWallet::LockNote(const SaplingOutPoint& output)
{
AssertLockHeld(cs_wallet);
setLockedSaplingNotes.insert(output);
}
void CWallet::UnlockNote(const SaplingOutPoint& output)
{
AssertLockHeld(cs_wallet);
setLockedSaplingNotes.erase(output);
}
void CWallet::UnlockAllSaplingNotes()
{
AssertLockHeld(cs_wallet);
setLockedSaplingNotes.clear();
}
bool CWallet::IsLockedNote(const SaplingOutPoint& output) const
{
AssertLockHeld(cs_wallet);
return (setLockedSaplingNotes.count(output) > 0);
}
std::vector<SaplingOutPoint> CWallet::ListLockedSaplingNotes()
{
AssertLockHeld(cs_wallet);
std::vector<SaplingOutPoint> vOutputs(setLockedSaplingNotes.begin(), setLockedSaplingNotes.end());
return vOutputs;
}
/** @} */ // end of Actions
class CAffectedKeysVisitor : public boost::static_visitor<void> {