Skip to content

Commit 5da3967

Browse files
committed
PackageV3Checks: Relax assumptions
Relax assumptions about in-mempool children of in-mempool parents. With package RBF, we will allow a package of size 2 with conflicts on its parent and reconsider the parent if its fee is insufficient on its own. Consider: TxA (in mempool) <- TxB (in mempool) TxA (in mempool) <- TxB' (in package, conflicts with TxB) <- TxC (in package) If TxB' fails to RBF TxB due to insufficient feerate, the package TxB' + TxC will be considered. PackageV3Checks called on TxB' will see an in-mempool parent TxA, and see the in-mempool child TxB. We cannot assume there is no in-mempool sibling, rather detect it and fail normally. Prior to package RBF, this would have failed on the first conflict in package.
1 parent b1ba1b1 commit 5da3967

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/policy/v3_policy.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ std::optional<std::string> PackageV3Checks(const CTransactionRef& ptx, int64_t v
9191
const auto parent_info = [&] {
9292
if (mempool_ancestors.size() > 0) {
9393
auto& mempool_parent = *mempool_ancestors.begin();
94-
Assume(mempool_parent->GetCountWithDescendants() == 1);
9594
return ParentInfo{mempool_parent->GetTx().GetHash(),
9695
mempool_parent->GetTx().GetWitnessHash(),
9796
mempool_parent->GetTx().nVersion,
@@ -135,10 +134,7 @@ std::optional<std::string> PackageV3Checks(const CTransactionRef& ptx, int64_t v
135134
}
136135
}
137136

138-
// It shouldn't be possible to have any mempool siblings at this point. SingleV3Checks
139-
// catches mempool siblings and sibling eviction is not extended to packages. Also, if the package consists of connected transactions,
140-
// any tx having a mempool ancestor would mean the package exceeds ancestor limits.
141-
if (!Assume(!parent_info.m_has_mempool_descendant)) {
137+
if (parent_info.m_has_mempool_descendant) {
142138
return strprintf("tx %s (wtxid=%s) would exceed descendant count limit",
143139
parent_info.m_txid.ToString(), parent_info.m_wtxid.ToString());
144140
}

0 commit comments

Comments
 (0)