Skip to content

Commit b4f28cc

Browse files
committed
[doc] parent pay for child in aggregate CheckFeeRate
1 parent f66af92 commit b4f28cc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/validation.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,12 @@ PackageMempoolAcceptResult MemPoolAccept::AcceptMultipleTransactions(const std::
12851285
// Transactions must meet two minimum feerates: the mempool minimum fee and min relay fee.
12861286
// For transactions consisting of exactly one child and its parents, it suffices to use the
12871287
// package feerate (total modified fees / total virtual size) to check this requirement.
1288+
// Note that this is an aggregate feerate; this function has not checked that there are transactions
1289+
// too low feerate to pay for themselves, or that the child transactions are higher feerate than
1290+
// their parents. Using aggregate feerate may allow "parents pay for child" behavior and permit
1291+
// a child that is below mempool minimum feerate. To avoid these behaviors, callers of
1292+
// AcceptMultipleTransactions need to restrict txns topology (e.g. to ancestor sets) and check
1293+
// the feerates of individuals and subsets.
12881294
const auto m_total_vsize = std::accumulate(workspaces.cbegin(), workspaces.cend(), int64_t{0},
12891295
[](int64_t sum, auto& ws) { return sum + ws.m_vsize; });
12901296
const auto m_total_modified_fees = std::accumulate(workspaces.cbegin(), workspaces.cend(), CAmount{0},

0 commit comments

Comments
 (0)