Skip to content

Commit

Permalink
Process every MempoolAcceptResult regardless of PackageValidationResult
Browse files Browse the repository at this point in the history
  • Loading branch information
glozow committed May 1, 2024
1 parent 2b482dc commit 6119f76
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3264,10 +3264,6 @@ void PeerManagerImpl::ProcessPackageResult(const PackageToValidate& package_to_v
// We currently only expect to process 1-parent-1-child packages. Remove if this changes.
if (!Assume(package.size() == 2)) return;

// No package results to look through for PCKG_POLICY or PCKG_MEMPOOL_ERROR
if (package_result.m_state.GetResult() == PackageValidationResult::PCKG_POLICY ||
package_result.m_state.GetResult() == PackageValidationResult::PCKG_MEMPOOL_ERROR) return;

// Iterate backwards to erase in-package descendants from the orphanage before they become
// relevant in AddChildrenToWorkSet.
auto package_iter = package.rbegin();
Expand All @@ -3276,7 +3272,9 @@ void PeerManagerImpl::ProcessPackageResult(const PackageToValidate& package_to_v
const auto& tx = *package_iter;
const NodeId nodeid = *senders_iter;
const auto it_result{package_result.m_tx_results.find(tx->GetWitnessHash())};
if (Assume(it_result != package_result.m_tx_results.end())) {

// It is not guaranteed that a result exists for every transaction.
if (it_result != package_result.m_tx_results.end()) {
const auto& tx_result = it_result->second;
switch (tx_result.m_result_type) {
case MempoolAcceptResult::ResultType::VALID:
Expand Down

0 comments on commit 6119f76

Please sign in to comment.