aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2024-05-01 13:48:03 +0100
committerglozow <gloriajzhao@gmail.com>2024-05-01 13:48:03 +0100
commit6119f76ef72c1adc55c1a384c20f8ba9e1a01206 (patch)
treeba35d4a5819a1a1e9fa32f98acafc3bcbdea68e4 /src/net_processing.cpp
parent2b482dc1f3fb248ccbe7eeb8c9c07d4bf1295a70 (diff)
downloadbitcoin-6119f76ef72c1adc55c1a384c20f8ba9e1a01206.tar.xz
Process every MempoolAcceptResult regardless of PackageValidationResult
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index d64c85ae9a..34f108f901 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -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();
@@ -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: