Merge bitcoin/bitcoin#36782: doc: fix comments referring to nonexistent functions
What changed, and why it matters
This commit only fixes comments and documentation. It renames references in comments to match the actual function/variable names in the code. No code behavior changes. No security impact.
No action needed. This is a documentation-only change with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit is a documentation-only patch. It updates comments across 38 files to reference the correct function names, variable names, or class members. No executable code was changed. No bug fixes, no logic changes, no security fixes.
Changed components
Inspect captured patch +71 / −73
### src/bench/txorphanage.cpp
@@ -25,7 +25,7 @@
static constexpr node::TxOrphanage::Usage TINY_TX_WEIGHT{240};
static constexpr int64_t APPROX_WEIGHT_PER_INPUT{200};
-// Creates a transaction with num_inputs inputs and 1 output, padded to target_weight. Use this function to maximize m_outpoint_to_orphan_it operations.
+// Creates a transaction with num_inputs inputs and 1 output, padded to target_weight. Use this function to maximize m_outpoint_to_orphan_wtxids operations.
// If num_inputs is 0, we maximize the number of inputs.
static CTransactionRef MakeTransactionBulkedTo(unsigned int num_inputs, int64_t target_weight, FastRandomContext& det_rand)
{
### src/common/args.h
@@ -193,7 +193,7 @@ class ArgsManager
[[nodiscard]] bool ReadConfigFiles(std::string& error, bool ignore_invalid_keys = false) EXCLUSIVE_LOCKS_REQUIRED(!cs_args);
/**
- * Log warnings for options in m_section_only_args when
+ * Log warnings for options in m_network_only_args when
* they are specified in the default section but not overridden
* on the command line or in a network-specific section in the
* config file.
### src/httpserver.cpp
@@ -89,7 +89,7 @@ bool HTTPServer::ClientAllowed(const CNetAddr& netaddr) const
/** Initialize ACL list for HTTP server */
bool HTTPServer::InitHTTPAllowList()
{
- // Must be run before StartSocketThreads() because ThreadSocketHandler()
+ // Must be run before StartSocketsThreads() because ThreadSocketHandler()
// will check m_allow_subnets from the I/O thread.
Assume(!m_thread_socket_handler.joinable());
### src/httpserver.h
@@ -644,7 +644,7 @@ class HTTPRemoteClient
};
/** Initialize HTTP server.
- * Call this before RegisterHTTPHandler or EventBase().
+ * Call this before RegisterHTTPHandler.
*/
bool InitHTTPServer();
### src/init.cpp
@@ -2175,7 +2175,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
});
/*
- * Wait for genesis block to be processed. Typically kernel_notifications.m_tip_block
+ * Wait for genesis block to be processed. Typically kernel_notifications.m_state.tip_block
* has already been set by a call to LoadChainTip() in CompleteChainstateInitialization().
* But this is skipped if the chainstate doesn't exist yet or is being wiped:
*
### src/interfaces/chain.h
@@ -97,7 +97,7 @@ using SettingsUpdate = std::function<std::optional<interfaces::SettingsAction>(c
//! internal workings of the bitcoin node, and not being very convenient to use.
//! Chain methods should be cleaned up and simplified over time. Examples:
//!
-//! * The initMessages() and showProgress() methods which the wallet uses to send
+//! * The initMessage() and showProgress() methods which the wallet uses to send
//! notifications to the GUI should go away when GUI and wallet can directly
//! communicate with each other without going through the node
//! (https://github.com/bitcoin/bitcoin/pull/15288#discussion_r253321096).
@@ -238,12 +238,12 @@ class Chain
// it means that one transaction has multiple change outputs or paid the same wallet using multiple
// outputs in the same transaction) or have shared ancestry, the bump fees are calculated
// independently, i.e. as if only one of them is spent. This may result in double-fee-bumping. This
- // caveat can be rectified per use of the sister-function CalculateCombinedBumpFee(…).
+ // caveat can be rectified per use of the sister-function calculateCombinedBumpFee(…).
virtual std::map<COutPoint, CAmount> calculateIndividualBumpFees(const std::vector<COutPoint>& outpoints, const CFeeRate& target_feerate) = 0;
//! Calculate the combined bump fee for an input set per the same strategy
- // as in CalculateIndividualBumpFees(…).
- // Unlike CalculateIndividualBumpFees(…), this does not return individual
+ // as in calculateIndividualBumpFees(…).
+ // Unlike calculateIndividualBumpFees(…), this does not return individual
// bump fees per outpoint, but a single bump fee for the shared ancestry.
// The combined bump fee may be used to correct overestimation due to
// shared ancestry by multiple UTXOs after coin selection.
### src/interfaces/ipc.h
@@ -36,7 +36,7 @@ class Init;
//! interfaces::Ipc::spawnProcess() then calls ipc::Protocol::connect()
//! passing the socketpair descriptor, which returns a local proxy
//! interfaces::Init implementation calling remote interfaces::Init methods.
-//! 2. The spawned process calls interfaces::Ipc::startSpawnProcess(), which
+//! 2. The spawned process calls interfaces::Ipc::startSpawnedProcess(), which
//! calls ipc::Process::checkSpawned() to read command line arguments and
//! determine whether it is a spawned process and what socketpair file
//! descriptor it should use. It then calls ipc::Protocol::serve() to handle
### src/ipc/capnp/common-types.h
@@ -33,7 +33,7 @@
namespace ipc {
namespace capnp {
-//! Construct a ParamStream wrapping a data stream with serialization parameters
+//! Construct a ParamsStream wrapping a data stream with serialization parameters
//! needed to pass transaction objects between bitcoin processes.
//! In the future, more params may be added here to serialize other objects that
//! require serialization parameters. Params should just be chosen to serialize
### src/net.cpp
@@ -828,7 +828,7 @@ CNetMessage V1Transport::GetReceivedMessage(NodeClock::time_point time, bool& re
AssertLockNotHeld(m_recv_mutex);
// Initialize out parameter
reject_message = false;
- // decompose a single CNetMessage from the TransportDeserializer
+ // decompose a single CNetMessage from the receive buffer
LOCK(m_recv_mutex);
CNetMessage msg(std::move(vRecv));
@@ -1276,7 +1276,7 @@ bool V2Transport::ProcessReceivedPacketBytes() noexcept
SetReceiveState(RecvState::APP);
break;
case RecvState::APP:
- // Application message decrypted correctly. It can be extracted using GetMessage().
+ // Application message decrypted correctly. It can be extracted using GetReceivedMessage().
SetReceiveState(RecvState::APP_READY);
break;
default:
@@ -1333,7 +1333,7 @@ size_t V2Transport::GetMaxBytesToProcess() noexcept
return BIP324Cipher::EXPANSION + m_recv_len - m_recv_buffer.size();
}
case RecvState::APP_READY:
- // No bytes can be processed until GetMessage() is called.
+ // No bytes can be processed until GetReceivedMessage() is called.
return 0;
case RecvState::V1:
// Not allowed (must be dealt with by the caller).
@@ -4200,7 +4200,7 @@ void CNode::MarkReceivedMsgsForProcessing()
size_t nSizeAdded = 0;
for (const auto& msg : vRecvMsg) {
// vRecvMsg contains only completed CNetMessage
- // the single possible partially deserialized message are held by TransportDeserializer
+ // the single possible partially deserialized message are held by m_transport
nSizeAdded += msg.GetMemoryUsage();
}
### src/net.h
@@ -527,12 +527,12 @@ class V2Transport final : public Transport
*
* A packet is received, and decrypted/verified. If that succeeds, the state becomes
* APP_READY and the decrypted contents is kept in m_recv_decode_buffer until it is
- * retrieved as a message by GetMessage(). */
+ * retrieved as a message by GetReceivedMessage(). */
APP,
- /** Nothing (an application packet is available for GetMessage()).
+ /** Nothing (an application packet is available for GetReceivedMessage()).
*
- * Nothing can be received in this state. When the message is retrieved by GetMessage,
+ * Nothing can be received in this state. When the message is retrieved by GetReceivedMessage,
* the state becomes APP again. */
APP_READY,
@@ -1823,7 +1823,7 @@ class CConnman
bool m_capture_messages{false};
/**
- * Mutex protecting m_i2p_sam_sessions.
+ * Mutex protecting m_unused_i2p_sessions.
*/
Mutex m_unused_i2p_sessions_mutex;
### src/net_processing.cpp
@@ -1778,7 +1778,7 @@ void PeerManagerImpl::FinalizeNode(const CNode& node)
{
LOCK(cs_main);
{
- // We remove the PeerRef from g_peer_map here, but we don't always
+ // We remove the PeerRef from m_peer_map here, but we don't always
// destruct the Peer. Sometimes another thread is still holding a
// PeerRef, so the refcount is >= 1. Be careful not to do any
// processing here that assumes Peer won't be changed before it's
### src/node/interfaces.cpp
@@ -688,7 +688,7 @@ class ChainImpl : public Chain
{
const TransactionError err = BroadcastTransaction(m_node, tx, err_string, max_tx_fee, max_tx_fee_rate, broadcast_method, /*wait_callback=*/false);
// Chain clients only care about failures to accept the tx to the mempool. Disregard non-mempool related failures.
- // Note: this will need to be updated if BroadcastTransactions() is updated to return other non-mempool failures
+ // Note: this will need to be updated if BroadcastTransaction() is updated to return other non-mempool failures
// that Chain clients do not need to know about.
return TransactionError::OK == err;
}
@@ -971,7 +971,7 @@ class MinerImpl : public Mining
std::unique_ptr<BlockTemplate> createNewBlock(const BlockCreateOptions& options, bool cooldown) override
{
- // Ensure m_tip_block is set so consumers of BlockTemplate can rely on that.
+ // Ensure m_state.tip_block is set so consumers of BlockTemplate can rely on that.
std::optional<BlockRef> maybe_tip{waitTipChanged(uint256::ZERO, MillisecondsDouble::max())};
if (!maybe_tip) return {};
### src/node/txdownloadman_impl.h
@@ -158,9 +158,9 @@ class TxDownloadManagerImpl {
/** Check whether we already have this gtxid in:
* - mempool
* - orphanage
- * - m_recent_rejects
- * - m_recent_rejects_reconsiderable (if include_reconsiderable = true)
- * - m_recent_confirmed_transactions
+ * - RecentRejectsFilter()
+ * - RecentRejectsReconsiderableFilter() (if include_reconsiderable = true)
+ * - RecentConfirmedTransactionsFilter()
* */
bool AlreadyHaveTx(const GenTxid& gtxid, bool include_reconsiderable);
### src/policy/truc_policy.h
@@ -36,7 +36,7 @@ inline constexpr int64_t TRUC_CHILD_MAX_WEIGHT{TRUC_CHILD_MAX_VSIZE * WITNESS_SC
static_assert(TRUC_MAX_VSIZE + TRUC_CHILD_MAX_VSIZE <= DEFAULT_CLUSTER_SIZE_LIMIT_KVB * 1000);
/** Must be called for every transaction, even if not TRUC. Not strictly necessary for transactions
- * accepted through AcceptMultipleTransactions.
+ * accepted through AcceptMultipleTransactionsInternal.
*
* Checks the following rules:
* 1. A TRUC tx must only have TRUC unconfirmed ancestors.
### src/primitives/block.h
@@ -78,7 +78,7 @@ class CBlock : public CBlockHeader
// Memory-only flags for caching expensive checks
mutable bool fChecked; // CheckBlock()
- mutable bool m_checked_witness_commitment{false}; // CheckWitnessCommitment()
+ mutable bool m_checked_witness_commitment{false}; // CheckWitnessMalleation()
mutable bool m_checked_merkle_root{false}; // CheckMerkleRoot()
CBlock()
### src/qt/bitcoin.cpp
@@ -362,7 +362,7 @@ void BitcoinApplication::requestShutdown()
#ifdef ENABLE_WALLET
// Delete wallet controller here manually, instead of relying on Qt object
// tracking (https://doc.qt.io/qt-5/objecttrees.html). This makes sure
- // walletmodel m_handle_* notification handlers are deleted before wallets
+ // walletmodel m_handler_* notification handlers are deleted before wallets
// are unloaded, which can simplify wallet implementations. It also avoids
// these notifications having to be handled while GUI objects are being
// destroyed, making GUI code less fragile as well.
@@ -490,7 +490,7 @@ int GuiMain(int argc, char* argv[])
btcsignals::scoped_connection handler_question{::uiInterface.ThreadSafeQuestion.connect(noui_ThreadSafeQuestion)};
btcsignals::scoped_connection handler_init_message{::uiInterface.InitMessage.connect(noui_InitMessage)};
- // Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory
+ // Do not refer to data directory yet, this can be overridden by Intro::showIfNeeded
/// 1. Basic Qt initialization (not dependent on parameters or configuration)
Q_INIT_RESOURCE(bitcoin);
### src/random.cpp
@@ -591,7 +591,7 @@ void ProcRand(unsigned char* out, int num, RNGLevel level, bool always_use_real_
} // namespace
-/** Internal function to set g_determinstic_rng. Only accessed from tests. */
+/** Internal function to set m_deterministic_prng. Only accessed from tests. */
void MakeRandDeterministicDANGEROUS(const uint256& seed) noexcept
{
GetRNGState().MakeDeterministic(seed);
### src/random.h
@@ -28,7 +28,7 @@
* The following (classes of) functions interact with that state by mixing in new
* entropy, and optionally extracting random output from it:
*
- * - GetRandBytes, GetRandHash, GetRandDur, as well as construction of FastRandomContext
+ * - GetRandBytes, GetRandHash, as well as construction of FastRandomContext
* objects, perform 'fast' seeding, consisting of mixing in:
* - A stack pointer (indirectly committing to calling thread and call stack)
* - A high-precision timestamp (rdtsc when available, c++ high_resolution_clock otherwise)
### src/scheduler.cpp
@@ -155,7 +155,7 @@ void SerialTaskRunner::ProcessQueue()
m_callbacks_pending.pop_front();
}
- // RAII the setting of fCallbacksRunning and calling MaybeScheduleProcessQueue
+ // RAII the setting of m_are_callbacks_running and calling MaybeScheduleProcessQueue
// to ensure both happen safely even if callback() throws.
struct RAIICallbacksRunning {
SerialTaskRunner* instance;
### src/script/descriptor.cpp
@@ -836,7 +836,7 @@ class MuSigPubkeyProvider final : public PubkeyProvider
return std::ranges::all_of(m_participants, [&](const auto& prov) { return prov->HavePrivateKeys(arg); });
}
- // Get RootPubKey and GetRootExtPubKey are used to return the single pubkey underlying the pubkey provider
+ // GetRootPubKey and GetRootExtPubKey are used to return the single pubkey underlying the pubkey provider
// to be presented to the user in gethdkeys. As this is a multisig construction, there is no single underlying
// pubkey hence nothing should be returned.
// While the aggregate pubkey could be returned as the root (ext)pubkey, it is not a pubkey that anyone should
### src/script/miniscript.h
@@ -1448,7 +1448,7 @@ class Node
auto ret = helper(node, subres);
// Do a consistency check between the satisfaction code and the type checker
- // (the actual satisfaction code in ProduceInputHelper does not use GetType)
+ // (the actual satisfaction code in ProduceInput does not use GetType)
// For 'z' nodes, available satisfactions/dissatisfactions must have stack size 0.
if (node.GetType() << "z"_mst && ret.nsat.available != Availability::NO) CHECK_NONFATAL(ret.nsat.stack.size() == 0);
@@ -1701,7 +1701,7 @@ class Node
bool IsSane() const { return IsValidTopLevel() && IsSaneSubexpression() && NeedsSignature(); }
//! Produce a witness for this script, if possible and given the information available in the context.
- //! The non-malleable satisfaction is guaranteed to be valid if it exists, and ValidSatisfaction()
+ //! The non-malleable satisfaction is guaranteed to be valid if it exists, and ValidSatisfactions()
//! is true. If IsSane() holds, this satisfaction is guaranteed to succeed in case the node's
//! conditions are satisfied (private keys and hash preimages available, locktimes satisfied).
template<typename Ctx>
@@ -1847,7 +1847,7 @@ void BuildBack(const MiniscriptContext script_ctx, Fragment nt, std::vector<Node
/**
* Parse a miniscript from its textual descriptor form.
* This does not check whether the script is valid, let alone sane. The caller is expected to use
- * the `IsValidTopLevel()` and `IsSaneTopLevel()` to check for these properties on the node.
+ * the `IsValidTopLevel()` and `IsSane()` to check for these properties on the node.
*/
template <typename Key, typename Ctx>
inline std::optional<Node<Key>> Parse(std::span<const char> in, const Ctx& ctx)
### src/script/signingprovider.h
@@ -294,10 +294,8 @@ class FillableSigningProvider : public SigningProvider
* future wallet code can have flexibility to be more selective about what
* transaction outputs it recognizes as payments, instead of having to treat
* all outputs spending to keys it knows as payments. By contrast,
- * mapScripts entries added by AddCScript(script),
- * LearnRelatedScripts(pubkey, type), and LearnAllRelatedScripts(pubkey)
- * calls are saved because they are all intentionally used to receive
- * payments.
+ * mapScripts entries added by AddCScript(script) calls are saved because
+ * they are all intentionally used to receive payments.
*
* The FillableSigningProvider::mapScripts script map should not be confused
* with the wallet::LegacyDataSPKM::setWatchOnly script set. The two collections
### src/serialize.h
@@ -1105,7 +1105,7 @@ struct ActionUnserialize {
* object of type SizeComputer, which only records the number of bytes written
* to it.
*
- * If your Serialize or SerializationOp method has non-trivial overhead for
+ * If your Serialize or SerializationOps method has non-trivial overhead for
* serialization, it may be worthwhile to implement a specialized version for
* SizeComputer, which uses the s.seek() method to record bytes that would
* be written instead.
### src/support/lockedpool.h
@@ -152,7 +152,7 @@ class LockedPool
size_t chunks_free;
};
- /** Create a new LockedPool. This takes ownership of the MemoryPageLocker,
+ /** Create a new LockedPool. This takes ownership of the LockedPageAllocator,
* you can only instantiate this with LockedPool(std::move(...)).
*
* The second argument is an optional callback when locking a newly allocated arena failed.
### src/test/argsman_tests.cpp
@@ -995,7 +995,7 @@ BOOST_FIXTURE_TEST_CASE(util_ArgsMerge, ArgsMergeTestingSetup)
//
// Results file is formatted like:
//
- // <input> || <IsArgSet/IsArgNegated/GetArg output> | <GetArgs output> | <GetUnsuitable output>
+ // <input> || <IsArgSet/IsArgNegated/GetArg output> | <GetArgs output> | <GetUnsuitableSectionOnlyArgs output>
BOOST_CHECK_EQUAL(out_sha_hex, "f1ee5ab094cc43d16a6086fa7f2c10389e0f99902616b31bbf29189972ad1473");
}
### src/test/denialofservice_tests.cpp
@@ -40,7 +40,7 @@ BOOST_FIXTURE_TEST_SUITE(denialofservice_tests, TestingSetup)
// Test eviction of an outbound peer whose chain never advances
// Mock a node connection, and use mocktime to simulate a peer
-// which never sends any headers messages. PeerLogic should
+// which never sends any headers messages. PeerManager should
// decide to evict that outbound peer, after the appropriate timeouts.
// Note that we protect 4 outbound nodes from being subject to
// this logic; this test takes advantage of that protection only
### src/test/fuzz/txrequest.cpp
@@ -64,7 +64,7 @@ struct Initializer
* as well.
*
* Check() calls the TxRequestTracker's sanity check, plus compares the
- * output of the constant accessors (Size(), CountLoad(), CountTracked())
+ * output of the constant accessors (Size(), Count(), CountInFlight(), CountCandidates())
* with expected values.
*/
class Tester
@@ -289,7 +289,7 @@ class Tester
void Check()
{
- // Compare CountTracked and CountLoad with naive structure.
+ // Compare Count, CountInFlight and CountCandidates with naive structure.
size_t total = 0;
for (int peer = 0; peer < MAX_PEERS; ++peer) {
size_t tracked = 0;
### src/test/validation_chainstate_tests.cpp
@@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE(validation_chainstate_resize_caches)
const auto outpoint = AddTestCoin(m_rng, c1.CoinsTip());
// Set a meaningless bestblock value in the coinsview cache - otherwise we won't
- // flush during ResizecoinsCaches() and will subsequently hit an assertion.
+ // flush during ResizeCoinsCaches() and will subsequently hit an assertion.
c1.CoinsTip().SetBestBlock(m_rng.rand256());
BOOST_CHECK(c1.CoinsTip().HaveCoinInCache(outpoint));
### src/test/validation_chainstatemanager_tests.cpp
@@ -765,7 +765,7 @@ BOOST_FIXTURE_TEST_CASE(chainstatemanager_snapshot_init, SnapshotTestSetup)
LOCK(chainman_restarted.GetMutex());
BOOST_CHECK_EQUAL(chainman_restarted.m_chainstates.size(), 2);
// Background chainstate has height of 109 not 110 here due to a quirk
- // of the LoadVerifyActivate only calling ActivateBestChain on one
+ // of LoadVerifyActivateChainstate() only calling ActivateBestChain on one
// chainstate. The height would be 110 after a real restart, but it's
// fine for this test which is focused on the snapshot chainstate.
BOOST_CHECK_EQUAL(chainman_restarted.m_chainstates[0]->m_chain.Height(), 109);
### src/txgraph.cpp
@@ -1638,7 +1638,7 @@ ClusterSetIndex TxGraphImpl::InsertCluster(int level, std::unique_ptr<Cluster>&&
// The passed-in Cluster must not currently be in the TxGraphImpl.
Assume(cluster->m_quality == QualityLevel::NONE);
- // Append it at the end of the relevant TxGraphImpl::m_cluster.
+ // Append it at the end of the relevant TxGraphImpl::ClusterSet::m_clusters.
auto& clusterset = GetClusterSet(level);
auto& quality_clusters = clusterset.m_clusters[int(quality)];
ClusterSetIndex ret = quality_clusters.size();
@@ -2957,7 +2957,7 @@ void TxGraphImpl::SanityCheck() const
assert(entry.m_locator[0].IsPresent());
expected_chunkindex.insert(idx);
}
- // Verify the Entry m_locators.
+ // Verify the Entry m_locator.
bool was_present{false}, was_removed{false};
for (int level = 0; level < MAX_LEVELS; ++level) {
const auto& locator = entry.m_locator[level];
@@ -3420,7 +3420,7 @@ std::vector<TxGraph::Ref*> TxGraphImpl::Trim() noexcept
// Sort deps_by_child by child transaction GraphIndex. The order will not be changed
// anymore after this.
std::ranges::sort(deps_by_child, [](auto& a, auto& b) noexcept { return a.second < b.second; });
- // Fill m_parents_count and m_parents_offset in trim_data, as well as m_deps_left, and
+ // Fill m_parent_count and m_parent_offset in trim_data, as well as m_deps_left, and
// initially populate trim_heap. Because of the sort above, all dependencies involving the
// same child are grouped together, so a single linear scan suffices.
auto deps_it = deps_by_child.begin();
### src/txmempool.h
@@ -456,7 +456,7 @@ class CTxMemPool
/** The minimum fee to get into the mempool, which may itself not be enough
* for larger-sized transactions.
- * The m_incremental_relay_feerate policy variable is used to bound the time it
+ * The incremental_relay_feerate policy variable is used to bound the time it
* takes the fee rate to go back down all the way to 0. When the feerate
* would otherwise be half of this, it is set to 0 instead.
*/
### src/txrequest.cpp
@@ -313,7 +313,7 @@ class TxRequestTracker::Impl {
public:
void SanityCheck() const
{
- // Recompute m_peerdata from m_index. This verifies the data in it as it should just be caching statistics
+ // Recompute m_peerinfo from m_index. This verifies the data in it as it should just be caching statistics
// on m_index. It also verifies the invariant that no PeerInfo announcements with m_total==0 exist.
assert(m_peerinfo == RecomputePeerInfo(m_index));
### src/txrequest.h
@@ -181,7 +181,7 @@ class TxRequestTracker {
* provided peer and txhash, nothing happens.
*
* It should be called whenever a transaction or NOTFOUND was received from a peer. When the transaction is
- * not needed entirely anymore, ForgetTxhash should be called instead of, or in addition to, this call.
+ * not needed entirely anymore, ForgetTxHash should be called instead of, or in addition to, this call.
*/
void ReceivedResponse(NodeId peer, const uint256& txhash);
### src/validation.cpp
@@ -413,7 +413,7 @@ static bool CheckInputsFromMempoolAndCache(const CTransaction& tx, TxValidationS
if (coin.IsSpent()) return false;
// If the Coin is available, there are 2 possibilities:
- // it is available in our current ChainstateActive UTXO set,
+ // it is available in the active chainstate UTXO set,
// or it's a UTXO provided by a transaction in our mempool.
// Ensure the scriptPubKeys in Coins from CoinsView are correct.
const CTransactionRef& txFrom = pool.get(txin.prevout.hash);
@@ -466,7 +466,7 @@ class MemPoolAccept
const bool m_allow_replacement;
/** When true, allow sibling eviction. This only occurs in single transaction package settings. */
const bool m_allow_sibling_eviction;
- /** Used to skip the LimitMempoolSize() call within AcceptSingleTransaction(). This should be used when multiple
+ /** Used to skip the LimitMempoolSize() call within AcceptSingleTransactionInternal(). This should be used when multiple
* AcceptSubPackage calls are expected and the mempool will be trimmed at the end of AcceptPackage(). */
const bool m_package_submission;
/** When true, use package feerates instead of individual transaction feerates for fee-based
@@ -598,11 +598,11 @@ class MemPoolAccept
/**
* Submission of a subpackage.
- * If subpackage size == 1, calls AcceptSingleTransaction() with adjusted ATMPArgs to
+ * If subpackage size == 1, calls AcceptSingleTransactionInternal() with adjusted ATMPArgs to
* enable sibling eviction and creates a PackageMempoolAcceptResult
* wrapping the result.
*
- * If subpackage size > 1, calls AcceptMultipleTransactions() with the provided ATMPArgs.
+ * If subpackage size > 1, calls AcceptMultipleTransactionsInternal() with the provided ATMPArgs.
*
* Also cleans up all non-chainstate coins from m_view at the end.
*/
@@ -662,7 +662,7 @@ class MemPoolAccept
// only tests that are fast should be done here (to avoid CPU DoS).
bool PreChecks(ATMPArgs& args, Workspace& ws) EXCLUSIVE_LOCKS_REQUIRED(cs_main, m_pool.cs);
- // Run checks for mempool replace-by-fee, only used in AcceptSingleTransaction.
+ // Run checks for mempool replace-by-fee, only used in AcceptSingleTransactionInternal.
bool ReplacementChecks(Workspace& ws) EXCLUSIVE_LOCKS_REQUIRED(cs_main, m_pool.cs);
bool PackageRBFChecks(const std::vector<CTransactionRef>& txns,
@@ -735,7 +735,7 @@ class MemPoolAccept
Chainstate& m_active_chainstate;
// Fields below are per *sub*package state and must be reset prior to subsequent
- // AcceptSingleTransaction and AcceptMultipleTransactions invocations
+ // AcceptSingleTransactionInternal and AcceptMultipleTransactionsInternal invocations
struct SubPackageState {
/** Aggregated modified fees of all transactions, used to calculate package feerate. */
CAmount m_total_modified_fees{0};
@@ -1042,7 +1042,7 @@ bool MemPoolAccept::PackageRBFChecks(const std::vector<CTransactionRef>& txns,
// If the package has in-mempool parents, we won't consider a package RBF
// since it would result in a cluster larger than 2.
// N.B. To relax this constraint we will need to revisit how CCoinsViewMemPool::PackageAddTransaction
- // is being used inside AcceptMultipleTransactions to track available inputs while processing a package.
+ // is being used inside AcceptMultipleTransactionsInternal to track available inputs while processing a package.
// Specifically we would need to check that the ancestors of the new
// transactions don't intersect with the set of transactions to be removed
// due to RBF, which is not checked at all in the package acceptance
@@ -1482,7 +1482,7 @@ PackageMempoolAcceptResult MemPoolAccept::AcceptMultipleTransactionsInternal(con
// too low feerate to pay for themselves, or that the child transactions are higher feerate than
// their parents. Using aggregate feerate may allow "parents pay for child" behavior and permit
// a child that is below mempool minimum feerate. To avoid these behaviors, callers of
- // AcceptMultipleTransactions need to restrict txns topology (e.g. to ancestor sets) and check
+ // AcceptMultipleTransactionsInternal need to restrict txns topology (e.g. to ancestor sets) and check
// the feerates of individuals and subsets.
m_subpackage.m_total_vsize = std::accumulate(workspaces.cbegin(), workspaces.cend(), int64_t{0},
[](int64_t sum, auto& ws) { return sum + ws.m_vsize; });
@@ -1658,7 +1658,7 @@ PackageMempoolAcceptResult MemPoolAccept::AcceptPackage(const Package& package,
// policy differences to pin or delay propagation of transactions. As such, it's possible for
// some package transaction(s) to already be in the mempool, and we don't want to reject the
// entire package in that case (as that could be a censorship vector). De-duplicate the
- // transactions that are already in the mempool, and only call AcceptMultipleTransactions() with
+ // transactions that are already in the mempool, and only call AcceptSubPackage() with
// the new transactions. This ensures we don't double-count transaction counts and sizes when
// checking ancestor/descendant limits, or double-count transaction fees for fee-related policy.
const auto& entry{*Assert(m_pool.GetEntry(txid))};
@@ -1776,7 +1776,7 @@ MempoolAcceptResult AcceptToMemoryPool(Chainstate& active_chainstate, const CTra
if (result.m_result_type != MempoolAcceptResult::ResultType::VALID) {
// 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
+ // AcceptSingleTransactionAndCleanup(); 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`).
@@ -4574,8 +4574,8 @@ BlockValidationState TestBlockValidity(
return state;
}
- // For signets CheckBlock() verifies the challenge iff fCheckPow is set.
- if (!CheckBlock(block, state, chainstate.m_chainman.GetConsensus(), /*fCheckPow=*/check_pow, /*fCheckMerkleRoot=*/check_merkle_root)) {
+ // For signets CheckBlock() verifies the challenge iff fCheckPOW is set.
+ if (!CheckBlock(block, state, chainstate.m_chainman.GetConsensus(), /*fCheckPOW=*/check_pow, /*fCheckMerkleRoot=*/check_merkle_root)) {
// This should never happen, but belt-and-suspenders don't approve the
// block if it does.
if (state.IsValid()) NONFATAL_UNREACHABLE();
@@ -4679,7 +4679,7 @@ bool Chainstate::LoadChainTip()
FormatISO8601DateTime(tip->GetBlockTime()),
m_chainman.GuessVerificationProgress(tip));
- // Ensure KernelNotifications m_tip_block is set even if no new block arrives.
+ // Ensure KernelNotifications::m_state.tip_block is set even if no new block arrives.
if (!this->GetRole().historical) {
// Ignoring return value for now.
(void)m_chainman.GetNotifications().blockTip(
### src/wallet/test/wallet_tests.cpp
@@ -585,7 +585,7 @@ BOOST_FIXTURE_TEST_CASE(BasicOutputTypesTest, ListCoinsTest)
BOOST_CHECK_EQUAL(available_coins.coins[OutputType::UNKNOWN].size(), expected_coins_sizes[OutputType::UNKNOWN]);
// We will create a self transfer for each of the OutputTypes and
- // verify it is put in the correct bucket after running GetAvailablecoins
+ // verify it is put in the correct bucket after running AvailableCoins
//
// For each OutputType, We expect 2 UTXOs in our wallet following the self transfer:
// 1. One UTXO as the recipient
### src/wallet/test/walletdb_tests.cpp
@@ -17,8 +17,8 @@ BOOST_FIXTURE_TEST_SUITE(walletdb_tests, BasicTestingSetup)
BOOST_AUTO_TEST_CASE(walletdb_readkeyvalue)
{
/**
- * When ReadKeyValue() reads from either a "key" or "wkey" it first reads the DataStream into a
- * CPrivKey or CWalletKey respectively and then reads a hash of the pubkey and privkey into a uint256.
+ * When LoadKey() reads from a "key", it first reads the DataStream into a CPrivKey, and then reads
+ * a hash of the pubkey and privkey into a uint256.
* Wallets from 0.8 or before do not store the pubkey/privkey hash, trying to read the hash from old
* wallets throws an exception, for backwards compatibility this read is wrapped in a try block to
* silently fail. The test here makes sure the type of exception thrown from DataStream::read()
### src/wallet/wallet.cpp
@@ -3138,7 +3138,7 @@ bool CWallet::IsTxImmatureCoinBase(const CWalletTx& wtx) const
{
AssertLockHeld(cs_wallet);
- // note GetBlocksToMaturity is 0 for non-coinbase tx
+ // note GetTxBlocksToMaturity is 0 for non-coinbase tx
return GetTxBlocksToMaturity(wtx) > 0;
}
### src/wallet/wallet.h
@@ -226,7 +226,7 @@ class ReserveDestination
ReserveDestination(const ReserveDestination&) = delete;
ReserveDestination& operator=(const ReserveDestination&) = delete;
- //! Destructor. If a key has been reserved and not KeepKey'ed, it will be returned to the keypool
+ //! Destructor. If a key has been reserved and not kept (see KeepDestination()), it will be returned to the keypool
~ReserveDestination()
{
ReturnDestination();
@@ -326,7 +326,7 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati
/** The next scheduled rebroadcast of wallet transactions. */
NodeClock::time_point m_next_resend{GetDefaultNextResend()};
/** Whether this wallet will submit newly created transactions to the node's mempool and
- * prompt rebroadcasts (see ResendWalletTransactions()). */
+ * prompt rebroadcasts (see ResubmitWalletTransactions()). */
bool fBroadcastTransactions = false;
// Local time that the tip block was received. Used to schedule wallet rebroadcasts.
std::atomic<int64_t> m_best_block_time {0};Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.