Skip to content

Commit 8ccab65

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#26238: clang-tidy: fixup named argument comments
203886c Fixup clang-tidy named argument comments (fanquake) Pull request description: Fix comments so they are checked/consistent. Fix incorrect comments. ACKs for top commit: hebasto: ACK 203886c, I have reviewed the code and it looks OK, I agree it can be merged. Tree-SHA512: e1257840f91fe39842e2b19299c1633604697b8584fe44b1977ada33cdde5433c877ed0b669fa334e20b04971dc89cd47d58b2783b6f7004521f01d05a1245da
2 parents edbe4f8 + 203886c commit 8ccab65

21 files changed

+51
-51
lines changed

src/bench/peer_eviction.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static void EvictionProtection0Networks250Candidates(benchmark::Bench& bench)
4040
{
4141
EvictionProtectionCommon(
4242
bench,
43-
250 /* num_candidates */,
43+
/*num_candidates=*/250,
4444
[](NodeEvictionCandidate& c) {
4545
c.m_connected = std::chrono::seconds{c.id};
4646
c.m_network = NET_IPV4;
@@ -51,7 +51,7 @@ static void EvictionProtection1Networks250Candidates(benchmark::Bench& bench)
5151
{
5252
EvictionProtectionCommon(
5353
bench,
54-
250 /* num_candidates */,
54+
/*num_candidates=*/250,
5555
[](NodeEvictionCandidate& c) {
5656
c.m_connected = std::chrono::seconds{c.id};
5757
c.m_is_local = false;
@@ -67,7 +67,7 @@ static void EvictionProtection2Networks250Candidates(benchmark::Bench& bench)
6767
{
6868
EvictionProtectionCommon(
6969
bench,
70-
250 /* num_candidates */,
70+
/*num_candidates=*/250,
7171
[](NodeEvictionCandidate& c) {
7272
c.m_connected = std::chrono::seconds{c.id};
7373
c.m_is_local = false;
@@ -85,7 +85,7 @@ static void EvictionProtection3Networks050Candidates(benchmark::Bench& bench)
8585
{
8686
EvictionProtectionCommon(
8787
bench,
88-
50 /* num_candidates */,
88+
/*num_candidates=*/50,
8989
[](NodeEvictionCandidate& c) {
9090
c.m_connected = std::chrono::seconds{c.id};
9191
c.m_is_local = (c.id == 28 || c.id == 47); // 2 localhost
@@ -103,7 +103,7 @@ static void EvictionProtection3Networks100Candidates(benchmark::Bench& bench)
103103
{
104104
EvictionProtectionCommon(
105105
bench,
106-
100 /* num_candidates */,
106+
/*num_candidates=*/100,
107107
[](NodeEvictionCandidate& c) {
108108
c.m_connected = std::chrono::seconds{c.id};
109109
c.m_is_local = (c.id >= 55 && c.id < 60); // 5 localhost
@@ -121,7 +121,7 @@ static void EvictionProtection3Networks250Candidates(benchmark::Bench& bench)
121121
{
122122
EvictionProtectionCommon(
123123
bench,
124-
250 /* num_candidates */,
124+
/*num_candidates=*/250,
125125
[](NodeEvictionCandidate& c) {
126126
c.m_connected = std::chrono::seconds{c.id};
127127
c.m_is_local = (c.id >= 140 && c.id < 160); // 20 localhost

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
15711571
}
15721572

15731573
if (args.GetBoolArg("-coinstatsindex", DEFAULT_COINSTATSINDEX)) {
1574-
g_coin_stats_index = std::make_unique<CoinStatsIndex>(interfaces::MakeChain(node), /* cache size */ 0, false, fReindex);
1574+
g_coin_stats_index = std::make_unique<CoinStatsIndex>(interfaces::MakeChain(node), /*cache_size=*/0, false, fReindex);
15751575
if (!g_coin_stats_index->Start()) {
15761576
return false;
15771577
}

src/psbt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ struct PSBTOutput
875875
throw std::ios_base::failure("Output Taproot tree has a leaf with an invalid leaf version");
876876
}
877877
m_tap_tree.push_back(std::make_tuple(depth, leaf_ver, script));
878-
builder.Add((int)depth, script, (int)leaf_ver, true /* track */);
878+
builder.Add((int)depth, script, (int)leaf_ver, /*track=*/true);
879879
}
880880
if (!builder.IsComplete()) {
881881
throw std::ios_base::failure("Output Taproot tree is malformed");

src/qt/coincontroldialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel *
477477
nBytes -= 34;
478478

479479
// Fee
480-
nPayFee = model->wallet().getMinimumFee(nBytes, m_coin_control, nullptr /* returned_target */, nullptr /* reason */);
480+
nPayFee = model->wallet().getMinimumFee(nBytes, m_coin_control, /*returned_target=*/nullptr, /*reason=*/nullptr);
481481

482482
if (nPayAmount > 0)
483483
{

src/qt/psbtoperationsdialog.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void PSBTOperationsDialog::openWithPSBT(PartiallySignedTransaction psbtx)
5656
bool complete = FinalizePSBT(psbtx); // Make sure all existing signatures are fully combined before checking for completeness.
5757
if (m_wallet_model) {
5858
size_t n_could_sign;
59-
TransactionError err = m_wallet_model->wallet().fillPSBT(SIGHASH_ALL, false /* sign */, true /* bip32derivs */, &n_could_sign, m_transaction_data, complete);
59+
TransactionError err = m_wallet_model->wallet().fillPSBT(SIGHASH_ALL, /*sign=*/false, /*bip32derivs=*/true, &n_could_sign, m_transaction_data, complete);
6060
if (err != TransactionError::OK) {
6161
showStatus(tr("Failed to load transaction: %1")
6262
.arg(QString::fromStdString(TransactionErrorString(err).translated)),
@@ -80,7 +80,7 @@ void PSBTOperationsDialog::signTransaction()
8080

8181
WalletModel::UnlockContext ctx(m_wallet_model->requestUnlock());
8282

83-
TransactionError err = m_wallet_model->wallet().fillPSBT(SIGHASH_ALL, true /* sign */, true /* bip32derivs */, &n_signed, m_transaction_data, complete);
83+
TransactionError err = m_wallet_model->wallet().fillPSBT(SIGHASH_ALL, /*sign=*/true, /*bip32derivs=*/true, &n_signed, m_transaction_data, complete);
8484

8585
if (err != TransactionError::OK) {
8686
showStatus(tr("Failed to sign transaction: %1")
@@ -245,7 +245,7 @@ size_t PSBTOperationsDialog::couldSignInputs(const PartiallySignedTransaction &p
245245

246246
size_t n_signed;
247247
bool complete;
248-
TransactionError err = m_wallet_model->wallet().fillPSBT(SIGHASH_ALL, false /* sign */, false /* bip32derivs */, &n_signed, m_transaction_data, complete);
248+
TransactionError err = m_wallet_model->wallet().fillPSBT(SIGHASH_ALL, /*sign=*/false, /*bip32derivs=*/false, &n_signed, m_transaction_data, complete);
249249

250250
if (err != TransactionError::OK) {
251251
return 0;

src/qt/test/apptests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void AppTests::appTests()
7272

7373
qRegisterMetaType<interfaces::BlockAndHeaderTipInfo>("interfaces::BlockAndHeaderTipInfo");
7474
m_app.parameterSetup();
75-
QVERIFY(m_app.createOptionsModel(true /* reset settings */));
75+
QVERIFY(m_app.createOptionsModel(/*resetSettings=*/true));
7676
QScopedPointer<const NetworkStyle> style(NetworkStyle::instantiate(Params().NetworkIDString()));
7777
m_app.setupPlatformStyle();
7878
m_app.createWindow(style.data());

src/qt/test/wallettests.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,17 @@ void TestGUI(interfaces::Node& node)
210210
// Send two transactions, and verify they are added to transaction list.
211211
TransactionTableModel* transactionTableModel = walletModel.getTransactionTableModel();
212212
QCOMPARE(transactionTableModel->rowCount({}), 105);
213-
uint256 txid1 = SendCoins(*wallet.get(), sendCoinsDialog, PKHash(), 5 * COIN, false /* rbf */);
214-
uint256 txid2 = SendCoins(*wallet.get(), sendCoinsDialog, PKHash(), 10 * COIN, true /* rbf */);
213+
uint256 txid1 = SendCoins(*wallet.get(), sendCoinsDialog, PKHash(), 5 * COIN, /*rbf=*/false);
214+
uint256 txid2 = SendCoins(*wallet.get(), sendCoinsDialog, PKHash(), 10 * COIN, /*rbf=*/true);
215215
QCOMPARE(transactionTableModel->rowCount({}), 107);
216216
QVERIFY(FindTx(*transactionTableModel, txid1).isValid());
217217
QVERIFY(FindTx(*transactionTableModel, txid2).isValid());
218218

219219
// Call bumpfee. Test disabled, canceled, enabled, then failing cases.
220-
BumpFee(transactionView, txid1, true /* expect disabled */, "not BIP 125 replaceable" /* expected error */, false /* cancel */);
221-
BumpFee(transactionView, txid2, false /* expect disabled */, {} /* expected error */, true /* cancel */);
222-
BumpFee(transactionView, txid2, false /* expect disabled */, {} /* expected error */, false /* cancel */);
223-
BumpFee(transactionView, txid2, true /* expect disabled */, "already bumped" /* expected error */, false /* cancel */);
220+
BumpFee(transactionView, txid1, /*expectDisabled=*/true, /*expectError=*/"not BIP 125 replaceable", /*cancel=*/false);
221+
BumpFee(transactionView, txid2, /*expectDisabled=*/false, /*expectError=*/{}, /*cancel=*/true);
222+
BumpFee(transactionView, txid2, /*expectDisabled=*/false, /*expectError=*/{}, /*cancel=*/false);
223+
BumpFee(transactionView, txid2, /*expectDisabled=*/true, /*expectError=*/"already bumped", /*cancel=*/false);
224224

225225
// Check current balance on OverviewPage
226226
OverviewPage overviewPage(platformStyle.get());

src/qt/walletmodel.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
217217
int nChangePosRet = -1;
218218

219219
auto& newTx = transaction.getWtx();
220-
const auto& res = m_wallet->createTransaction(vecSend, coinControl, !wallet().privateKeysDisabled() /* sign */, nChangePosRet, nFeeRequired);
220+
const auto& res = m_wallet->createTransaction(vecSend, coinControl, /*sign=*/!wallet().privateKeysDisabled(), nChangePosRet, nFeeRequired);
221221
newTx = res ? *res : nullptr;
222222
transaction.setTransactionFee(nFeeRequired);
223223
if (fSubtractFeeFromAmount && newTx)
@@ -258,7 +258,7 @@ void WalletModel::sendCoins(WalletModelTransaction& transaction)
258258
}
259259

260260
auto& newTx = transaction.getWtx();
261-
wallet().commitTransaction(newTx, {} /* mapValue */, std::move(vOrderForm));
261+
wallet().commitTransaction(newTx, /*value_map=*/{}, std::move(vOrderForm));
262262

263263
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
264264
ssTx << *newTx;
@@ -542,7 +542,7 @@ bool WalletModel::bumpFee(uint256 hash, uint256& new_hash)
542542
if (retval == QMessageBox::Save) {
543543
PartiallySignedTransaction psbtx(mtx);
544544
bool complete = false;
545-
const TransactionError err = wallet().fillPSBT(SIGHASH_ALL, false /* sign */, true /* bip32derivs */, nullptr, psbtx, complete);
545+
const TransactionError err = wallet().fillPSBT(SIGHASH_ALL, /*sign=*/false, /*bip32derivs=*/true, nullptr, psbtx, complete);
546546
if (err != TransactionError::OK || complete) {
547547
QMessageBox::critical(nullptr, tr("Fee bump error"), tr("Can't draft transaction."));
548548
return false;

src/rpc/server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ std::string CRPCTable::help(const std::string& strCommand, const JSONRPCRequest&
103103
{
104104
UniValue unused_result;
105105
if (setDone.insert(pcmd->unique_id).second)
106-
pcmd->actor(jreq, unused_result, true /* last_handler */);
106+
pcmd->actor(jreq, unused_result, /*last_handler=*/true);
107107
}
108108
catch (const std::exception& e)
109109
{

src/test/sync_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ BOOST_AUTO_TEST_CASE(potential_deadlock_detected)
107107
#ifdef DEBUG_LOCKORDER
108108
BOOST_AUTO_TEST_CASE(double_lock_mutex)
109109
{
110-
TestDoubleLock<Mutex>(true /* should throw */);
110+
TestDoubleLock<Mutex>(/*should_throw=*/true);
111111
}
112112

113113
BOOST_AUTO_TEST_CASE(double_lock_recursive_mutex)
114114
{
115-
TestDoubleLock<RecursiveMutex>(false /* should not throw */);
115+
TestDoubleLock<RecursiveMutex>(/*should_throw=*/false);
116116
}
117117
#endif /* DEBUG_LOCKORDER */
118118

0 commit comments

Comments
 (0)