aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 3cd815da26..70aa51b102 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -1525,9 +1525,19 @@ PackageMempoolAcceptResult MemPoolAccept::AcceptPackage(const Package& package,
Assume(results_final.count(wtxid) == 0);
results_final.emplace(wtxid, multi_submission_result.m_tx_results.at(wtxid));
} else if (const auto it{results_final.find(wtxid)}; it != results_final.end()) {
- // Already-in-mempool transaction.
+ // Already-in-mempool transaction. Check to see if it's still there, as it could have
+ // been evicted when LimitMempoolSize() was called.
Assume(it->second.m_result_type != MempoolAcceptResult::ResultType::INVALID);
Assume(individual_results_nonfinal.count(wtxid) == 0);
+ // Query by txid to include the same-txid-different-witness ones.
+ if (!m_pool.exists(GenTxid::Txid(tx->GetHash()))) {
+ package_state_final.Invalid(PackageValidationResult::PCKG_TX, "transaction failed");
+ TxValidationState mempool_full_state;
+ mempool_full_state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "mempool full");
+ // Replace the previous result.
+ results_final.erase(wtxid);
+ results_final.emplace(wtxid, MempoolAcceptResult::Failure(mempool_full_state));
+ }
} else if (const auto it{individual_results_nonfinal.find(wtxid)}; it != individual_results_nonfinal.end()) {
Assume(it->second.m_result_type == MempoolAcceptResult::ResultType::INVALID);
// Interesting result from previous processing.