aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Rochard <pierre@rochard.org>2018-08-01 18:23:19 -0400
committerPierre Rochard <pierre@rochard.org>2018-08-03 15:30:08 -0400
commit3339d845354c9c357ec90505192748d9d639e72e (patch)
tree7fc387a0c175c9cc8b5cc2ee8e4e5196bf8559f0
parent1ef57a96b8b7255bd1f1ea0583846f18305419bf (diff)
[trivial] add doxygen-compatible comments to CAffectedKeysVisitor
-rw-r--r--src/wallet/wallet.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 218684fdf1..1c2a93ac4f 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -102,14 +102,25 @@ std::string COutput::ToString() const
return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString(), i, nDepth, FormatMoney(tx->tx->vout[i].nValue));
}
+/** A class to identify which pubkeys a script and a keystore have in common. */
class CAffectedKeysVisitor : public boost::static_visitor<void> {
private:
const CKeyStore &keystore;
std::vector<CKeyID> &vKeys;
public:
+ /**
+ * @param[in] keystoreIn The CKeyStore that is queried for the presence of a pubkey.
+ * @param[out] vKeysIn A vector to which a script's pubkey identifiers are appended if they are in the keystore.
+ */
CAffectedKeysVisitor(const CKeyStore &keystoreIn, std::vector<CKeyID> &vKeysIn) : keystore(keystoreIn), vKeys(vKeysIn) {}
+ /**
+ * Apply the visitor to each destination in a script, recursively to the redeemscript
+ * in the case of p2sh destinations.
+ * @param[in] script The CScript from which destinations are extracted.
+ * @post Any CKeyIDs that script and keystore have in common are appended to the visitor's vKeys.
+ */
void Process(const CScript &script) {
txnouttype type;
std::vector<CTxDestination> vDest;