Skip to content

Commit e8f387f

Browse files
committed
Merge #13843: [trivial] Add doxygen-compatible comments to CAffectedKeysVisitor
3339d84 [trivial] add doxygen-compatible comments to CAffectedKeysVisitor (Pierre Rochard) Pull request description: Tree-SHA512: 0003fde198a6977d0c8988efc8f76428f9e095009fddf131b07bd9809ef76a778c86bb2b1305e33df16101b6b703cf43eb6193462bb9f3687f98c1d9b109dd96
2 parents 1cd5f2c + 3339d84 commit e8f387f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/wallet/wallet.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,25 @@ std::string COutput::ToString() const
102102
return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString(), i, nDepth, FormatMoney(tx->tx->vout[i].nValue));
103103
}
104104

105+
/** A class to identify which pubkeys a script and a keystore have in common. */
105106
class CAffectedKeysVisitor : public boost::static_visitor<void> {
106107
private:
107108
const CKeyStore &keystore;
108109
std::vector<CKeyID> &vKeys;
109110

110111
public:
112+
/**
113+
* @param[in] keystoreIn The CKeyStore that is queried for the presence of a pubkey.
114+
* @param[out] vKeysIn A vector to which a script's pubkey identifiers are appended if they are in the keystore.
115+
*/
111116
CAffectedKeysVisitor(const CKeyStore &keystoreIn, std::vector<CKeyID> &vKeysIn) : keystore(keystoreIn), vKeys(vKeysIn) {}
112117

118+
/**
119+
* Apply the visitor to each destination in a script, recursively to the redeemscript
120+
* in the case of p2sh destinations.
121+
* @param[in] script The CScript from which destinations are extracted.
122+
* @post Any CKeyIDs that script and keystore have in common are appended to the visitor's vKeys.
123+
*/
113124
void Process(const CScript &script) {
114125
txnouttype type;
115126
std::vector<CTxDestination> vDest;

0 commit comments

Comments
 (0)