@@ -81,17 +81,16 @@ std::optional<std::string> PackageV3Checks(const CTransactionRef& ptx, int64_t v
81
81
vsize, V3_CHILD_MAX_VSIZE);
82
82
}
83
83
84
+ // Exactly 1 parent exists, either in mempool or package. Find it.
84
85
const auto parent_info = [&] {
85
86
if (mempool_ancestors.size () > 0 ) {
86
- // There's a parent in the mempool.
87
87
auto & mempool_parent = *mempool_ancestors.begin ();
88
88
Assume (mempool_parent->GetCountWithDescendants () == 1 );
89
89
return ParentInfo{mempool_parent->GetTx ().GetHash (),
90
90
mempool_parent->GetTx ().GetWitnessHash (),
91
91
mempool_parent->GetTx ().nVersion ,
92
92
/* has_mempool_descendant=*/ mempool_parent->GetCountWithDescendants () > 1 };
93
93
} else {
94
- // Ancestor must be in the package. Find it.
95
94
auto & parent_index = in_package_parents.front ();
96
95
auto & package_parent = package.at (parent_index);
97
96
return ParentInfo{package_parent->GetHash (),
@@ -184,7 +183,7 @@ std::optional<std::string> SingleV3Checks(const CTransactionRef& ptx,
184
183
// The rest of the rules only apply to transactions with nVersion=3.
185
184
if (ptx->nVersion != 3 ) return std::nullopt;
186
185
187
- // Check that V3_ANCESTOR_LIMIT would not be violated, including both in-package and in-mempool .
186
+ // Check that V3_ANCESTOR_LIMIT would not be violated.
188
187
if (mempool_ancestors.size () + 1 > V3_ANCESTOR_LIMIT) {
189
188
return strprintf (" tx %s (wtxid=%s) would have too many ancestors" ,
190
189
ptx->GetHash ().ToString (), ptx->GetWitnessHash ().ToString ());
0 commit comments