From 69ab52cb3e8610c2e0272836282ce7f5673756da Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Thu, 30 Mar 2023 14:22:34 -0600 Subject: [PATCH] Improve Doxygen for note locking --- src/wallet/wallet_tx_builder.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/wallet/wallet_tx_builder.h b/src/wallet/wallet_tx_builder.h index 8ec1864c1..ac5ff34bc 100644 --- a/src/wallet/wallet_tx_builder.h +++ b/src/wallet/wallet_tx_builder.h @@ -160,10 +160,6 @@ private: int anchorHeight; public: - /** - * This class locks the `SpendableInputs` provided to it. `UnlockSpendable` must be called to - * release them before the instance goes out of scope. - */ TransactionEffects( uint32_t anchorConfirmations, SpendableInputs spendable, @@ -192,13 +188,18 @@ public: } /** - * This is automatically called by the constructor, so it’s not generally necessary to call this - * otherwise. + * This should be called upon creating `TransactionEffects`, it locks exactly the notes that + * will be spent in the built transaction. */ void LockSpendable(CWallet& wallet) const; /** - * This should be called just before the `TransactionEffects` goes out of scope. + * This should be called when we are finished with the transaction (whether it succeeds or + * fails). + * + * TODO: This currently needs to be called while the `TransactionEffects` exists. In future, it + * would be useful to keep these notes locked until we have confirmation that the tx is on + * the chain or not. */ void UnlockSpendable(CWallet& wallet) const;