Skip to content

Commit 66daf4c

Browse files
committed
Merge #21567: docs: fix various misleading comments
4eca20d [doc] correct comment about ATMPW (glozow) 8fa74ae [doc] correct comment in chainparams (glozow) 2f8272c [doc] GetBestBlock() doesn't do nothing (gzhao408) Pull request description: Came across a few misleading comments, wanted to fix them ACKs for top commit: jnewbery: ACK 4eca20d MarcoFalke: ACK 4eca20d laanwj: Code review ACK 4eca20d Tree-SHA512: 5bef1f1e7703f304128cf0eb8945e139e031580c99062bbbe15bf4db8443c2ba5a8c65844833132e6646c8980c678fc1d2ab0c63e17105585d583570ee350fd0
2 parents 086226d + 4eca20d commit 66daf4c

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/chainparams.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits
5656
}
5757

5858
/**
59-
* Main network
59+
* Main network on which people trade goods and services.
6060
*/
6161
class CMainParams : public CChainParams {
6262
public:
@@ -173,7 +173,7 @@ class CMainParams : public CChainParams {
173173
};
174174

175175
/**
176-
* Testnet (v3)
176+
* Testnet (v3): public test network which is reset from time to time.
177177
*/
178178
class CTestNetParams : public CChainParams {
179179
public:
@@ -266,7 +266,7 @@ class CTestNetParams : public CChainParams {
266266
};
267267

268268
/**
269-
* Signet
269+
* Signet: test network with an additional consensus parameter (see BIP325).
270270
*/
271271
class SigNetParams : public CChainParams {
272272
public:
@@ -373,7 +373,8 @@ class SigNetParams : public CChainParams {
373373
};
374374

375375
/**
376-
* Regression test
376+
* Regression test: intended for private networks only. Has minimal difficulty to ensure that
377+
* blocks can be found instantly.
377378
*/
378379
class CRegTestParams : public CChainParams {
379380
public:

src/chainparams.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@ struct ChainTxData {
6464

6565
/**
6666
* CChainParams defines various tweakable parameters of a given instance of the
67-
* Bitcoin system. There are three: the main network on which people trade goods
68-
* and services, the public test network which gets reset from time to time and
69-
* a regression test mode which is intended for private networks only. It has
70-
* minimal difficulty to ensure that blocks can be found instantly.
67+
* Bitcoin system.
7168
*/
7269
class CChainParams
7370
{

src/validation.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,8 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
690690
}
691691
}
692692

693-
// Bring the best block into scope
693+
// This is const, but calls into the back end CoinsViews. The CCoinsViewDB at the bottom of the
694+
// hierarchy brings the best block into scope. See CCoinsViewDB::GetBestBlock().
694695
m_view.GetBestBlock();
695696

696697
// we have all inputs cached now, so switch back to dummy (to protect
@@ -1099,9 +1100,9 @@ static MempoolAcceptResult AcceptToMemoryPoolWithTime(const CChainParams& chainp
10991100
assert(std::addressof(::ChainstateActive()) == std::addressof(active_chainstate));
11001101
const MempoolAcceptResult result = MemPoolAccept(pool, active_chainstate).AcceptSingleTransaction(tx, args);
11011102
if (result.m_result_type != MempoolAcceptResult::ResultType::VALID) {
1102-
// Remove coins that were not present in the coins cache before calling ATMPW;
1103-
// this is to prevent memory DoS in case we receive a large number of
1104-
// invalid transactions that attempt to overrun the in-memory coins cache
1103+
// Remove coins that were not present in the coins cache before calling
1104+
// AcceptSingleTransaction(); this is to prevent memory DoS in case we receive a large
1105+
// number of invalid transactions that attempt to overrun the in-memory coins cache
11051106
// (`CCoinsViewCache::cacheCoins`).
11061107

11071108
for (const COutPoint& hashTx : coins_to_uncache)

0 commit comments

Comments
 (0)