diff options
author | Greg Sanders <gsanders87@gmail.com> | 2024-03-26 15:28:37 -0400 |
---|---|---|
committer | Greg Sanders <gsanders87@gmail.com> | 2024-06-10 13:17:04 -0400 |
commit | 5da396781589177d4ceb3b4b59c9f309a5e4d029 (patch) | |
tree | f58777bdcf46233bada8e270456ca0dde37def46 /src | |
parent | b1ba1b178f501daa1afdd91f9efec34e5ec1e294 (diff) | |
download | bitcoin-5da396781589177d4ceb3b4b59c9f309a5e4d029.tar.xz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/policy/v3_policy.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/policy/v3_policy.cpp b/src/policy/v3_policy.cpp index 9151d97ac2..73c4d2a707 100644 --- a/src/policy/v3_policy.cpp +++ b/src/policy/v3_policy.cpp @@ -91,7 +91,6 @@ std::optional<std::string> PackageV3Checks(const CTransactionRef& ptx, int64_t v const auto parent_info = [&] { if (mempool_ancestors.size() > 0) { auto& mempool_parent = *mempool_ancestors.begin(); - Assume(mempool_parent->GetCountWithDescendants() == 1); return ParentInfo{mempool_parent->GetTx().GetHash(), mempool_parent->GetTx().GetWitnessHash(), mempool_parent->GetTx().nVersion, @@ -135,10 +134,7 @@ std::optional<std::string> PackageV3Checks(const CTransactionRef& ptx, int64_t v } } - // It shouldn't be possible to have any mempool siblings at this point. SingleV3Checks - // catches mempool siblings and sibling eviction is not extended to packages. Also, if the package consists of connected transactions, - // any tx having a mempool ancestor would mean the package exceeds ancestor limits. - if (!Assume(!parent_info.m_has_mempool_descendant)) { + if (parent_info.m_has_mempool_descendant) { return strprintf("tx %s (wtxid=%s) would exceed descendant count limit", parent_info.m_txid.ToString(), parent_info.m_wtxid.ToString()); } |