@@ -451,6 +451,11 @@ class CWalletKey
451451class CWallet : public CCryptoKeyStore , public CValidationInterface
452452{
453453private:
454+ /* *
455+ * Select a set of coins such that nValueRet >= nTargetValue and at least
456+ * all coins from coinControl are selected; Never select unconfirmed coins
457+ * if they are not ours
458+ */
454459 bool SelectCoins (const CAmount& nTargetValue, std::set<std::pair<const CWalletTx*,unsigned int > >& setCoinsRet, CAmount& nValueRet, const CCoinControl *coinControl = NULL ) const ;
455460
456461 CWalletDB *pwalletdbEncryption;
@@ -552,9 +557,12 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
552557 * populate vCoins with vector of available COutputs.
553558 */
554559 void AvailableCoins (std::vector<COutput>& vCoins, bool fOnlyConfirmed =true , const CCoinControl *coinControl = NULL , bool fIncludeZeroValue =false ) const ;
560+
555561 /* *
556- * Select coins until nTargetValue is reached. Return the actual value
557- * and the corresponding coin set.
562+ * Shuffle and select coins until nTargetValue is reached while avoiding
563+ * small change; This method is stochastic for some inputs and upon
564+ * completion the coin set and corresponding actual target value is
565+ * assembled
558566 */
559567 bool SelectCoinsMinConf (const CAmount& nTargetValue, int nConfMine, int nConfTheirs, std::vector<COutput> vCoins, std::set<std::pair<const CWalletTx*,unsigned int > >& setCoinsRet, CAmount& nValueRet) const ;
560568
@@ -638,7 +646,17 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
638646 CAmount GetWatchOnlyBalance () const ;
639647 CAmount GetUnconfirmedWatchOnlyBalance () const ;
640648 CAmount GetImmatureWatchOnlyBalance () const ;
649+
650+ /* *
651+ * Insert additional inputs into the transaction by
652+ * calling CreateTransaction();
653+ */
641654 bool FundTransaction (CMutableTransaction& tx, CAmount& nFeeRet, int & nChangePosRet, std::string& strFailReason, bool includeWatching);
655+
656+ /* *
657+ * Create a new transaction paying the recipients with a set of coins
658+ * selected by SelectCoins(); Also create the change output, when needed
659+ */
642660 bool CreateTransaction (const std::vector<CRecipient>& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, int & nChangePosRet,
643661 std::string& strFailReason, const CCoinControl *coinControl = NULL , bool sign = true );
644662 bool CommitTransaction (CWalletTx& wtxNew, CReserveKey& reservekey);
0 commit comments