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> {

View File

@ -942,6 +942,7 @@ public:
std::set<COutPoint> setLockedCoins;
std::set<JSOutPoint> setLockedSproutNotes;
std::set<SaplingOutPoint> setLockedSaplingNotes;
int64_t nTimeFirstKey;
@ -963,13 +964,17 @@ public:
void UnlockAllCoins();
void ListLockedCoins(std::vector<COutPoint>& vOutpts);
bool IsLockedNote(const JSOutPoint& outpt) const;
void LockNote(const JSOutPoint& output);
void UnlockNote(const JSOutPoint& output);
void UnlockAllSproutNotes();
std::vector<JSOutPoint> ListLockedSproutNotes();
bool IsLockedNote(const SaplingOutPoint& output) const;
void LockNote(const SaplingOutPoint& output);
void UnlockNote(const SaplingOutPoint& output);
void UnlockAllSaplingNotes();
std::vector<SaplingOutPoint> ListLockedSaplingNotes();
/**
* keystore implementation