diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index be6c6ea7f..770a18d38 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3858,6 +3858,37 @@ std::vector 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 CWallet::ListLockedSaplingNotes() +{ + AssertLockHeld(cs_wallet); + std::vector vOutputs(setLockedSaplingNotes.begin(), setLockedSaplingNotes.end()); + return vOutputs; +} + /** @} */ // end of Actions class CAffectedKeysVisitor : public boost::static_visitor { diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 31d228442..ade0d4143 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -942,6 +942,7 @@ public: std::set setLockedCoins; std::set setLockedSproutNotes; + std::set setLockedSaplingNotes; int64_t nTimeFirstKey; @@ -963,13 +964,17 @@ public: void UnlockAllCoins(); void ListLockedCoins(std::vector& vOutpts); - bool IsLockedNote(const JSOutPoint& outpt) const; void LockNote(const JSOutPoint& output); void UnlockNote(const JSOutPoint& output); void UnlockAllSproutNotes(); std::vector ListLockedSproutNotes(); + bool IsLockedNote(const SaplingOutPoint& output) const; + void LockNote(const SaplingOutPoint& output); + void UnlockNote(const SaplingOutPoint& output); + void UnlockAllSaplingNotes(); + std::vector ListLockedSaplingNotes(); /** * keystore implementation