Skip to content

Commit c4761ff

Browse files
committed
Merge pull request #5146
5b40d88 Update comments in wallet to be doxygen compatible (Michael Ford)
2 parents 393a28a + 5b40d88 commit c4761ff

File tree

2 files changed

+125
-89
lines changed

2 files changed

+125
-89
lines changed

src/wallet.cpp

Lines changed: 46 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (c) 2009-2010 Satoshi Nakamoto
22
// Copyright (c) 2009-2014 The Bitcoin developers
3-
// Distributed under the MIT/X11 software license, see the accompanying
3+
// Distributed under the MIT software license, see the accompanying
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

66
#include "wallet.h"
@@ -22,18 +22,23 @@
2222

2323
using namespace std;
2424

25-
// Settings
25+
/**
26+
* Settings
27+
*/
2628
CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE);
2729
unsigned int nTxConfirmTarget = 1;
2830
bool bSpendZeroConfChange = true;
2931

30-
/** Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) */
31-
CFeeRate CWallet::minTxFee = CFeeRate(10000); // Override with -mintxfee
32+
/**
33+
* Fees smaller than this (in satoshi) are considered zero fee (for transaction creation)
34+
* Override with -mintxfee
35+
*/
36+
CFeeRate CWallet::minTxFee = CFeeRate(10000);
3237

33-
//////////////////////////////////////////////////////////////////////////////
34-
//
35-
// mapWallet
36-
//
38+
/** @defgroup mapWallet
39+
*
40+
* @{
41+
*/
3742

3843
struct CompareValueOnly
3944
{
@@ -367,8 +372,10 @@ void CWallet::SyncMetaData(pair<TxSpends::iterator, TxSpends::iterator> range)
367372
}
368373
}
369374

370-
// Outpoint is spent if any non-conflicted transaction
371-
// spends it:
375+
/**
376+
* Outpoint is spent if any non-conflicted transaction
377+
* spends it:
378+
*/
372379
bool CWallet::IsSpent(const uint256& hash, unsigned int n) const
373380
{
374381
const COutPoint outpoint(hash, n);
@@ -477,7 +484,7 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
477484
{
478485
if (!pwalletdbEncryption->TxnCommit()) {
479486
delete pwalletdbEncryption;
480-
// We now have keys encrypted in memory, but no on disk...
487+
// We now have keys encrypted in memory, but not on disk...
481488
// die to avoid confusion and let the user reload their unencrypted wallet.
482489
assert(false);
483490
}
@@ -667,9 +674,11 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet)
667674
return true;
668675
}
669676

670-
// Add a transaction to the wallet, or update it.
671-
// pblock is optional, but should be provided if the transaction is known to be in a block.
672-
// If fUpdate is true, existing transactions will be updated.
677+
/**
678+
* Add a transaction to the wallet, or update it.
679+
* pblock is optional, but should be provided if the transaction is known to be in a block.
680+
* If fUpdate is true, existing transactions will be updated.
681+
*/
673682
bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate)
674683
{
675684
{
@@ -911,9 +920,11 @@ bool CWalletTx::WriteToDisk()
911920
return CWalletDB(pwallet->strWalletFile).WriteTx(GetHash(), *this);
912921
}
913922

914-
// Scan the block chain (starting in pindexStart) for transactions
915-
// from or to us. If fUpdate is true, found transactions that already
916-
// exist in the wallet will be updated.
923+
/**
924+
* Scan the block chain (starting in pindexStart) for transactions
925+
* from or to us. If fUpdate is true, found transactions that already
926+
* exist in the wallet will be updated.
927+
*/
917928
int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
918929
{
919930
int ret = 0;
@@ -1035,15 +1046,15 @@ void CWallet::ResendWalletTransactions()
10351046
}
10361047
}
10371048

1049+
/** @} */ // end of mapWallet
10381050

10391051

10401052

10411053

1042-
1043-
//////////////////////////////////////////////////////////////////////////////
1044-
//
1045-
// Actions
1046-
//
1054+
/** @defgroup Actions
1055+
*
1056+
* @{
1057+
*/
10471058

10481059

10491060
CAmount CWallet::GetBalance() const
@@ -1136,7 +1147,9 @@ CAmount CWallet::GetImmatureWatchOnlyBalance() const
11361147
return nTotal;
11371148
}
11381149

1139-
// populate vCoins with vector of available COutputs.
1150+
/**
1151+
* populate vCoins with vector of available COutputs.
1152+
*/
11401153
void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const CCoinControl *coinControl) const
11411154
{
11421155
vCoins.clear();
@@ -1194,7 +1207,7 @@ static void ApproximateBestSubset(vector<pair<CAmount, pair<const CWalletTx*,uns
11941207
//The solver here uses a randomized algorithm,
11951208
//the randomness serves no real security purpose but is just
11961209
//needed to prevent degenerate behavior and it is important
1197-
//that the rng fast. We do not use a constant random sequence,
1210+
//that the rng is fast. We do not use a constant random sequence,
11981211
//because there may be some privacy improvement by making
11991212
//the selection random.
12001213
if (nPass == 0 ? insecure_rand()&1 : !vfIncluded[i])
@@ -1524,7 +1537,9 @@ bool CWallet::CreateTransaction(CScript scriptPubKey, const CAmount& nValue,
15241537
return CreateTransaction(vecSend, wtxNew, reservekey, nFeeRet, strFailReason, coinControl);
15251538
}
15261539

1527-
// Call after CreateTransaction unless you want to abort
1540+
/**
1541+
* Call after CreateTransaction unless you want to abort
1542+
*/
15281543
bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey)
15291544
{
15301545
{
@@ -1669,7 +1684,7 @@ DBErrors CWallet::ZapWalletTx(std::vector<CWalletTx>& vWtx)
16691684
setKeyPool.clear();
16701685
// Note: can't top-up keypool here, because wallet is locked.
16711686
// User will be prompted to unlock wallet the next operation
1672-
// the requires a new key.
1687+
// that requires a new key.
16731688
}
16741689
}
16751690

@@ -1736,10 +1751,10 @@ bool CWallet::SetDefaultKey(const CPubKey &vchPubKey)
17361751
return true;
17371752
}
17381753

1739-
//
1740-
// Mark old keypool keys as used,
1741-
// and generate all new keys
1742-
//
1754+
/**
1755+
* Mark old keypool keys as used,
1756+
* and generate all new keys
1757+
*/
17431758
bool CWallet::NewKeyPool()
17441759
{
17451760
{
@@ -2120,6 +2135,7 @@ void CWallet::ListLockedCoins(std::vector<COutPoint>& vOutpts)
21202135
}
21212136
}
21222137

2138+
/** @} */ // end of Actions
21232139

21242140
class CAffectedKeysVisitor : public boost::static_visitor<void> {
21252141
private:

0 commit comments

Comments
 (0)