mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-11 21:22:47 +01:00
[validation] de-duplicate package transactions already in mempool
As node operators are free to set their mempool policies however they please, it's possible for package transaction(s) to already be in the mempool. We definitely don't want to reject the entire package in that case (as that could be a censorship vector). We should still return the successful result to the caller, so add another result type to MempoolAcceptResult.
This commit is contained in:
@@ -974,6 +974,8 @@ static RPCHelpMan testmempoolaccept()
|
||||
continue;
|
||||
}
|
||||
const auto& tx_result = it->second;
|
||||
// Package testmempoolaccept doesn't allow transactions to already be in the mempool.
|
||||
CHECK_NONFATAL(tx_result.m_result_type != MempoolAcceptResult::ResultType::MEMPOOL_ENTRY);
|
||||
if (tx_result.m_result_type == MempoolAcceptResult::ResultType::VALID) {
|
||||
const CAmount fee = tx_result.m_base_fees.value();
|
||||
// Check that fee does not exceed maximum fee
|
||||
|
||||
Reference in New Issue
Block a user