aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index e82fead89e..0fa7cbbabd 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -844,9 +844,18 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
return state.Invalid(TxValidationResult::TX_NOT_STANDARD, "bad-txns-too-many-sigops",
strprintf("%d", nSigOpsCost));
- // No individual transactions are allowed below the min relay feerate and mempool min feerate except from
- // disconnected blocks and transactions in a package. Package transactions will be checked using
- // package feerate later.
+ // No individual transactions are allowed below the min relay feerate except from disconnected blocks.
+ // This requirement, unlike CheckFeeRate, cannot be bypassed using m_package_feerates because,
+ // while a tx could be package CPFP'd when entering the mempool, we do not have a DoS-resistant
+ // method of ensuring the tx remains bumped. For example, the fee-bumping child could disappear
+ // due to a replacement.
+ if (!bypass_limits && ws.m_modified_fees < m_pool.m_min_relay_feerate.GetFee(ws.m_vsize)) {
+ return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "min relay fee not met",
+ strprintf("%d < %d", ws.m_modified_fees, m_pool.m_min_relay_feerate.GetFee(ws.m_vsize)));
+ }
+ // No individual transactions are allowed below the mempool min feerate except from disconnected
+ // blocks and transactions in a package. Package transactions will be checked using package
+ // feerate later.
if (!bypass_limits && !args.m_package_feerates && !CheckFeeRate(ws.m_vsize, ws.m_modified_fees, state)) return false;
ws.m_iters_conflicting = m_pool.GetIterSet(ws.m_conflicts);