Skip to content

Commit a9c73a1

Browse files
author
MarcoFalke
committed
[wallet] Add comments for doxygen
1 parent 6b0e622 commit a9c73a1

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

src/wallet/wallet.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,6 +1842,7 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt
18421842
LOCK2(cs_main, cs_wallet);
18431843
{
18441844
nFeeRet = 0;
1845+
// Start with no fee and loop until there is enough fee
18451846
while (true)
18461847
{
18471848
txNew.vin.clear();

src/wallet/wallet.h

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,11 @@ class CWalletKey
451451
class CWallet : public CCryptoKeyStore, public CValidationInterface
452452
{
453453
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+
*/
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

Comments
 (0)