@@ -451,6 +451,11 @@ class CWalletKey
451
451
class CWallet : public CCryptoKeyStore , public CValidationInterface
452
452
{
453
453
private:
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
+ */
454
459
bool SelectCoins (const CAmount& nTargetValue, std::set<std::pair<const CWalletTx*,unsigned int > >& setCoinsRet, CAmount& nValueRet, const CCoinControl *coinControl = NULL ) const ;
455
460
456
461
CWalletDB *pwalletdbEncryption;
@@ -552,9 +557,12 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
552
557
* populate vCoins with vector of available COutputs.
553
558
*/
554
559
void AvailableCoins (std::vector<COutput>& vCoins, bool fOnlyConfirmed =true , const CCoinControl *coinControl = NULL , bool fIncludeZeroValue =false ) const ;
560
+
555
561
/* *
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
558
566
*/
559
567
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 ;
560
568
@@ -638,7 +646,17 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
638
646
CAmount GetWatchOnlyBalance () const ;
639
647
CAmount GetUnconfirmedWatchOnlyBalance () const ;
640
648
CAmount GetImmatureWatchOnlyBalance () const ;
649
+
650
+ /* *
651
+ * Insert additional inputs into the transaction by
652
+ * calling CreateTransaction();
653
+ */
641
654
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
+ */
642
660
bool CreateTransaction (const std::vector<CRecipient>& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, int & nChangePosRet,
643
661
std::string& strFailReason, const CCoinControl *coinControl = NULL , bool sign = true );
644
662
bool CommitTransaction (CWalletTx& wtxNew, CReserveKey& reservekey);
0 commit comments