mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-02 09:15:04 +02:00
Merge #19339: validation: re-delegate absurd fee checking from mempool to clients
b048b275d9[validation] Remove absurdfee from accepttomempool (John Newbery)932564b9cfscripted-diff: update max-fee-exceeded error message to include RPC (gzhao408)8f1290c601[rpc/node] check for high fee before ATMP in clients (gzhao408) Pull request description: Picked up from #15810. Add separate fee-checking logic for clients that need to enforce max fee rates, then remove the `absurdFee` logic from ATMP. ATMP's `nAbsurdFee` argument is used to enforce user-specific behavior (it is not policy since it isn't applied consistently: it is only ever used in RPC and wallet, and set to 0 everywhere else internally). It should be removed from `AcceptToMemoryPool` because (1) validation results/mempool behavior should not be user-specific and (2) enforcing a max fee rate should be the responsibility of the client instead of the mempool. Note: this PR does not intend to _remove_ protection from high fees, just re-delegate the responsibility to clients. ACKs for top commit: jnewbery: utACKb048b275d9LarryRuane: re-ACKb048b275d9MarcoFalke: re-ACKb048b275d9, only change is squashing one commit 🏦 instagibbs: utACKb048b275d9Tree-SHA512: 57c17ba16d230a4cae2896dd6a64c924f307757824e35784bf96da7b10aff2d8ea910710edf35e981035623a155f8766209a92a0fdb856549fde78bc3eaae4d2
This commit is contained in:
@@ -40,8 +40,7 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_reject_coinbase, TestChain100Setup)
|
||||
false,
|
||||
AcceptToMemoryPool(*m_node.mempool, state, MakeTransactionRef(coinbaseTx),
|
||||
nullptr /* plTxnReplaced */,
|
||||
true /* bypass_limits */,
|
||||
0 /* nAbsurdFee */));
|
||||
true /* bypass_limits */));
|
||||
|
||||
// Check that the transaction hasn't been added to mempool.
|
||||
BOOST_CHECK_EQUAL(m_node.mempool->size(), initialPoolSize);
|
||||
|
||||
@@ -30,7 +30,7 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup)
|
||||
|
||||
TxValidationState state;
|
||||
return AcceptToMemoryPool(*m_node.mempool, state, MakeTransactionRef(tx),
|
||||
nullptr /* plTxnReplaced */, true /* bypass_limits */, 0 /* nAbsurdFee */);
|
||||
nullptr /* plTxnReplaced */, true /* bypass_limits */);
|
||||
};
|
||||
|
||||
// Create a double-spend of mature coinbase txn:
|
||||
|
||||
@@ -291,8 +291,7 @@ BOOST_AUTO_TEST_CASE(mempool_locks_reorg)
|
||||
state,
|
||||
tx,
|
||||
&plTxnReplaced,
|
||||
/* bypass_limits */ false,
|
||||
/* nAbsurdFee */ 0));
|
||||
/* bypass_limits */ false));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user