aboutsummaryrefslogtreecommitdiff
path: root/src/policy
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2024-02-09 22:06:26 +0000
committerglozow <gloriajzhao@gmail.com>2024-02-12 14:27:25 +0000
commit63b62e123e38cb92c2135e63eb1a5b760c11dd4e (patch)
tree02b878e043997d9f932506de1c9963ca283c1ffb /src/policy
parente3c17112ddfe740e5ab4c652d80ed1a19c13da5a (diff)
downloadbitcoin-63b62e123e38cb92c2135e63eb1a5b760c11dd4e.tar.xz
[doc] fix docs and comments from v3
Diffstat (limited to 'src/policy')
-rw-r--r--src/policy/v3_policy.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/policy/v3_policy.cpp b/src/policy/v3_policy.cpp
index 158881aeb9..f838dc6c0f 100644
--- a/src/policy/v3_policy.cpp
+++ b/src/policy/v3_policy.cpp
@@ -81,9 +81,9 @@ std::optional<std::string> PackageV3Checks(const CTransactionRef& ptx, int64_t v
vsize, V3_CHILD_MAX_VSIZE);
}
+ // Exactly 1 parent exists, either in mempool or package. Find it.
const auto parent_info = [&] {
if (mempool_ancestors.size() > 0) {
- // There's a parent in the mempool.
auto& mempool_parent = *mempool_ancestors.begin();
Assume(mempool_parent->GetCountWithDescendants() == 1);
return ParentInfo{mempool_parent->GetTx().GetHash(),
@@ -91,7 +91,6 @@ std::optional<std::string> PackageV3Checks(const CTransactionRef& ptx, int64_t v
mempool_parent->GetTx().nVersion,
/*has_mempool_descendant=*/mempool_parent->GetCountWithDescendants() > 1};
} else {
- // Ancestor must be in the package. Find it.
auto& parent_index = in_package_parents.front();
auto& package_parent = package.at(parent_index);
return ParentInfo{package_parent->GetHash(),
@@ -184,7 +183,7 @@ std::optional<std::string> SingleV3Checks(const CTransactionRef& ptx,
// The rest of the rules only apply to transactions with nVersion=3.
if (ptx->nVersion != 3) return std::nullopt;
- // Check that V3_ANCESTOR_LIMIT would not be violated, including both in-package and in-mempool.
+ // Check that V3_ANCESTOR_LIMIT would not be violated.
if (mempool_ancestors.size() + 1 > V3_ANCESTOR_LIMIT) {
return strprintf("tx %s (wtxid=%s) would have too many ancestors",
ptx->GetHash().ToString(), ptx->GetWitnessHash().ToString());