aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorW. J. van der Laan <laanwj@protonmail.com>2021-04-01 19:00:34 +0200
committerW. J. van der Laan <laanwj@protonmail.com>2021-04-01 19:12:10 +0200
commit66daf4cb3b47e8218623936d23ad504fd189e70b (patch)
tree384482dd453e6e4e7d0b38bd4d6a1eb529096965 /src/validation.cpp
parent086226d98ae8c194a0a38b2fbfffd0dc3773e879 (diff)
parent4eca20d6f7d850492d331d89d1cdd77abb3c70c1 (diff)
downloadbitcoin-66daf4cb3b47e8218623936d23ad504fd189e70b.tar.xz
Merge #21567: docs: fix various misleading comments
4eca20d6f7d850492d331d89d1cdd77abb3c70c1 [doc] correct comment about ATMPW (glozow) 8fa74aeb5b96419c7d40b40f8e1e1269509278e2 [doc] correct comment in chainparams (glozow) 2f8272c2a4b6fa84c04dfeb4d751bb218f2d4c78 [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 4eca20d6f7 MarcoFalke: ACK 4eca20d6f7d850492d331d89d1cdd77abb3c70c1 laanwj: Code review ACK 4eca20d6f7d850492d331d89d1cdd77abb3c70c1 Tree-SHA512: 5bef1f1e7703f304128cf0eb8945e139e031580c99062bbbe15bf4db8443c2ba5a8c65844833132e6646c8980c678fc1d2ab0c63e17105585d583570ee350fd0
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index b5c19971b4..19363c0efb 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -690,7 +690,8 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
}
}
- // Bring the best block into scope
+ // This is const, but calls into the back end CoinsViews. The CCoinsViewDB at the bottom of the
+ // hierarchy brings the best block into scope. See CCoinsViewDB::GetBestBlock().
m_view.GetBestBlock();
// we have all inputs cached now, so switch back to dummy (to protect
@@ -1099,9 +1100,9 @@ static MempoolAcceptResult AcceptToMemoryPoolWithTime(const CChainParams& chainp
assert(std::addressof(::ChainstateActive()) == std::addressof(active_chainstate));
const MempoolAcceptResult result = MemPoolAccept(pool, active_chainstate).AcceptSingleTransaction(tx, args);
if (result.m_result_type != MempoolAcceptResult::ResultType::VALID) {
- // Remove coins that were not present in the coins cache before calling ATMPW;
- // this is to prevent memory DoS in case we receive a large number of
- // invalid transactions that attempt to overrun the in-memory coins cache
+ // Remove coins that were not present in the coins cache before calling
+ // AcceptSingleTransaction(); this is to prevent memory DoS in case we receive a large
+ // number of invalid transactions that attempt to overrun the in-memory coins cache
// (`CCoinsViewCache::cacheCoins`).
for (const COutPoint& hashTx : coins_to_uncache)